I’m quite new to PsychoPy, so forgive me if this is obvious but I missed it. When attempting to save / restore the last options in a dialog using tofile/fromfile, my values come back, but my list of options do not. So, for example:
params = {'Duration':2.0,
'ISI':0.5,
'Phase': ['Phase 1','Phase 2']}
try:#try to get a previous parameters file
params = tools.filetools.fromFile('lastParams.pickle')
except: #if not there then use a default set
print('Could not load last set of parameters')
dictDlg = gui.DlgFromDict(dictionary=params, title='Experiment parameters')
if dictDlg.OK:
tools.filetools.toFile('lastParams.pickle', params)
else:
print('User Cancelled')
Run the first time (or without lastParams.pickle), I get a nice choice-box for the Phase entry. When I load it from lastParams.pickle, I get the value (e.g., Phase 1) as plain text and not as my nice choice-box.
Any ideas? Also, how best to set a default set of values while maintaining my nice choice boxes?
Craig