Skip to content

Instantly share code, notes, and snippets.

@flipphillips
Created December 14, 2012 00:13
Show Gist options
  • Save flipphillips/4281335 to your computer and use it in GitHub Desktop.
Save flipphillips/4281335 to your computer and use it in GitHub Desktop.
PsychoPy: ask for info
# get subject information
expInfo = {u'session': u'001', u'subject': u''}
dlg = gui.DlgFromDict(dictionary=expInfo, title='Sweep Acuity')
if dlg.OK == False:
core.quit() # user pressed cancel
expInfo['date'] = data.getDateStr() # add a simple timestamp
# Setup files for saving
if not os.path.isdir('data'):
os.makedirs('data') # if this fails (e.g. permissions) we will get error
# we'll use this down below as the output EEG file
filename = 'data' + os.path.sep + '%s_%s_%s_eeg.csv' % (expInfo['date'], expInfo['subject'], expInfo['session'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment