Running PsychoPy v3.2.4, Builder.
If I type the name of a string variable into the allowed keys field of a keyboard component, instead of the name of a list variable, the consequences are as follows.
- This change, and any subsequent changes to the program, are saved (the ‘date modified’ of the .psyexp file is updated).
- However, when the program is run, the ‘_lastrun.py’ file is not updated (the ‘date modified’ of this file remains the same as before) and the version of the program that runs is an old version corresponding to the ‘_lastrun.py’ file.
- If I make a copy of the .psyexp file and run it from a folder where the ‘_lastrun.py’ file is not present, the program fails to run. It crashes immediately, without prompting for experiment info, and gives the following error message:
C:\Program Files\PsychoPy3\python.exe: can’t open file ‘D:\Users…\IAT_lastrun.py’: [Errno 2] No such file or directory
The documentation for the keyboard component does state that the allowed keys field should contain the name of a list variable. However, I think this error should be caught because an inexperienced user would tend to assume that this field will accept the name of a string variable, for example a string called ‘correct’ which has been read from a conditions file. Also, it requires some basic knowledge of coding to use this field correctly, for which some users will require guidance. For example, I had to first place my string called ‘correct’ inside a list variable, using a code component:
allowed_response = [correct]