You can also use the logging functions to send a log message at the end
of each trial. That would carry less overhead than writing an excel file
repeatedly, so might be better. See the coder demo on logging for that.
I always add a function to shut down the experiment (e.g. when subjects
press 'q') and I normally include saving data in that shutdown routine.
best wishes,
Jon
--
Dr. Jonathan Peirce
Nottingham Visual Neuroscience
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
on each stimulus loop, after your particpant has responded, simply
write the trial number, stim params and response (even time) out to a
defined file: something like:
#define all your stimuli....
#now loop through your stim list
for i in range(1,100):
#show a stim with psychopy
stim.draw()
win.flip()
#wait for a response
while response == 'None':
#wait
#now you have a response
f = open('mylogfile.txt','a') #open a named file in 'append' mode
f.write('the things I want written to the logfile')
f.close()
I can rattle together a real example if you like.
good luck
Andre'
> --
> You received this message because you are subscribed to the Google Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=en.
>
>
Jon
On 27/05/2011 16:59, Mickael Le Gal wrote:
> Dear Jon,
>
> I'm currently running a kind of Go/No-Go experiment with psychopy and
> I'm struggling to tell psychopy that not pressing any key when the
> screen displays a No-Go cue is the right answer. Ultimately that
> causes some problems when the data are saved into the excel file.
>
> Is there anything I should do with the Excel file? Is there something
> I should add to the "allowedKeys"? Do you know a good trick to solve
> this problem?
>
> I also want to randomize the duration of each cue so I created a
> column in the excel file with random numbers and made it correspond
> with the builder. This works pretty fine when the screen displays a Go
> cue but somehow crashes when a No-Go signal appears. Is there you
> would suggest me to do?
>
> Thank you very much for your help.
>
> Best
>