AttributeError: setColor

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 3.0.1
Standard Standalone? (y/n) Y
What are you trying to achieve?:
I am working on a modified stroop version. Just before the start of the stimuli, the subject has to keep a specific digit in memory and enter it again after each word of the stroop task.

What did you try to make it work?:
For this purpose I loaded the information about the colour of the stimuli into psychopy and saved them in a list. For a fully random colour (combined with the correct answer) I worked with two tutorials ( PsychoPy Scripting and Randomizing Stimulus Lists -- PsychoPy Tutorial #8 - YouTube & Using Code to Randomize Two Lists of Stimuli within a Single Loop -- PsychoPy Mini Tutorials - YouTube).

The stimulus list is looking like this:

What specifically went wrong when you tried that?:
The experiment is working, until the text object is trying to load in the colour. Itā€™s somehow not working, but in a previous version there is no problem.

Here is the error:

    target.setColor(colour[colour_order[cur_colour]], colorSpace='rgb')

AttributeError: ā€˜listā€™ object has no attribute ā€˜setColorā€™

I used the print command, to see if the list is acutally filled with colours. This is working correct.

The error is still stopping the experiment if the colour is set to white.

Thank you all!

Hi,

Is there a specific reason why you donā€™t simply do something like this?:

pic

Jan

1 Like

Hi Jan,
Thank you for fast reply :slight_smile:
For my experiment it is necessary to randomize the stimuli completly and not only the rows of the excel file.
I somehow solved the problem by my own. The setting of the loop (fully random) crashed the experiment. If it is set to sequential itā€™s working.
Thank you very much :slight_smile:

Iā€™m glad it works, but Iā€™m not sure I follow. If youā€™d like to, feel free to explain in more detail: Iā€™m not sure what you mean by ā€œto randomise the stimuli completely and not only the rows of the Excel fileā€. Also, selecting ā€œfully randomā€ as the loopType certainly shouldnā€™t crash your experiment. If sequential is what you need (i.e., if the rows in your input file already are in the order you want your trials to be in), thatā€™s of course what you should use, but Iā€™m not sure how this aligns with what youā€™ve described above. Also, feel free to upload your solution (.psyexp and input file).

Jan