I’ve ran across one more similar NameError: Within my Code Component (in Begin Routine), I’m referencing a variable from an .xlsx file, which was successfully associated with the “Trial” Loop. Specifically, I want certain stimuli presented, depending on the current condition defined in the Excel file. However, I’ve been getting another NameError, despite trying everything I could think of:
Running: /Users/Steve/Dropbox/Research and Course Files/Software/PsychoPy Stuff/Visual Search Sample/visualsearch_lastrun.py 2016-08-07 22:24:51.589 python[12320:1121007] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/2k/x2jwcbj10_d4nvggs451003w0000gn/T/org.psychopy.PsychoPy2.savedState Traceback (most recent call last): File "/Users/Steve/Dropbox/Research and Course Files/Software/PsychoPy Stuff/Visual Search Sample/visualsearch_lastrun.py", line 221, in <module> **if conditionLabel == "one":** NameError: name 'conditionLabel' is not defined
Specifically, the part in bold indicates the line of code that references the Excel file. In Coder view, it appears that the Excel file is being loaded by the Trial Handler immediately prior to the start of my Trial loop, so I don’t think its an “order” issue. The experiment appears to execute if I set the variable conditionLabel in my custom code to a constant (e.g.,
conditionLabel = one). Still getting the hang of things, and thank you for your help!