Using a simple GUI

PsychoPy includes support for simple GUI dialogues to get input from the user.

from psychopy import gui

#create a dictionary of information
info = {'Observer':'jwp', 'GratingOri':45, 'ExpVersion': 1.1}
#create and display the dialogue based on info
infoDlg = gui.DlgFromDict(dictionary=info,
    title='TestExperiment',
    fixed=['ExpVersion'])#can include list of fields that user can't edit

#did the user press ok?
if infoDlg.OK:
    print info
else:
    print 'User Cancelled'

#add some info to your dictionary
info['somethingSecret'] = "boo!"
 
Valid XHTML 1.0! Valid CSS!