I’m on Windows 10 and just freshly installed the latest versions of Psychopy (1.85.2) and wxPython (4.0.0b1), but for the first time I’m getting problems making dialog boxes. Everything else in PsychoPy seems to work great.
Here’s the error I get whenever I try to make a dialog box:
Traceback (most recent call last):
File "D:/Dropbox/Yale/Projects/Prototype Effect/code/prototype_effect_razer.py", line 261, in <module>
expInfo = enterSubInfo(expName)
File "D:/Dropbox/Yale/Projects/Prototype Effect/code/prototype_effect_razer.py", line 24, in enterSubInfo
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName, fixed=['dateStr'])
File "C:\Python27\lib\site-packages\psychopy\gui\wxgui.py", line 249, in __init__
Dlg.__init__(self, title)
File "C:\Python27\lib\site-packages\psychopy\gui\wxgui.py", line 64, in __init__
wx.Dialog.__init__(self, None, -1, title, pos, size, style)
TypeError: Dialog(): arguments did not match any overloaded call:
overload 1: too many arguments
overload 2: argument 4 has unexpected type 'NoneType'
Process finished with exit code 1
Here’s the code I’m using (which has worked on multiple operating systems, machines, and PsychoPy installations before):
def enterSubInfo(expName): # GUI for entering experiment info
try:
expInfo = misc.fromFile(
expName + '_' + '#' + '_' + 'lastParams.pickle') # note the '#', for file-ordering purposes
except:
expInfo = {'Experiment': expName, 'Testing Location': '', 'Experimenter Initials': 'sdu',
'Subject Initials': '', 'Subject ID': '', 'Subject Age': '', 'Subject Gender': ''}
expInfo['dateStr'] = data.getDateStr()
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName, fixed=['dateStr'])
if dlg.OK:
misc.toFile(expName + '_' + '#' + '_' + 'lastParams.pickle',
expInfo) # note the '#', for file-ordering purposes
else:
core.quit()
return expInfo
expName = 'PE1'
expInfo = enterSubInfo(expName)
Any thoughts as to how I can fix the problem?