Hi, new to PsychoPy and I’m assuming there’s an obvious fix to this I just can’t figure it out.
I’ve built a conditions file to loop over that contains 2 parameters: number_of_choices and background_image.
background_image contains a list of image files I want to loop over (each one corresponds to a different trial condition) and number_of_choices is a variable that corresponds to each image/trial condition.
Basically, I want to be able to use the variable number_of_choices in my code, but I get the following error message:
Traceback (most recent call last):
File “/Users/xiao/Documents/Blaisdell Lab/pigeon study/Hicks Pigeon ONE ROUTINE CODE.py”, line 357, in
i = randint(1,number_of_choices)
File “mtrand.pyx”, line 993, in mtrand.RandomState.randint
ValueError: low >= high
I know parameters in conditions files can be accessed through components in builder with $, but I’m not sure how to refer to the parameters in my code. Or maybe I shouldn’t be putting variables as parameters in my conditions file and there’s another way to do this?