Hi there, I am running the following code to create a dialog box:
#present a dialogue to change params
dlg = gui.DlgFromDict(dictionary=expInfo,
title = 'Gabor Motion Contrast',
order = ['participantID', 'condition', 'practice'],
labels = {'participantID': 'Participant ID', 'condition': 'Condition','practice': 'Practice'},
tip = {'participantID': 'The unique identifer for each participant.', 'condition': 'The current experimental condition.'})
if dlg.OK:
toFile('lastParams.pickle', expInfo)
else:
core.quit()
I am receiving the following error:
Traceback (most recent call last):
File "C:\XXXXXXXXX\GaborContrast.py", line 90, in <module>
tip = {'participantID': 'The unique identifer for each participant.', 'condition': 'The current experimental condition.'})
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui\qtgui.py", line 489, in __init__
self.show()
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui\qtgui.py", line 498, in show
self.dictionary[thisKey] = self.inputFieldTypes[thisKey](self.data[n])
KeyError: 'participantID'
##### Experiment ended. #####
The dialog box opens, and all the fields are rendered correctly, including the labels. Once I click “OK” this exception is thrown.
If I do not include the labels argument the programme works without error.
Has anyone successfully used the labels argument before? I cannot find an example of how to do this successfully.
TIA