If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10):
PsychoPy version (e.g. 1.84.x):
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:
I have a loop composed of two images
I want the first image to appear on the screen for a random duration between 5 and 10 seconds. I want this random time to be newly selected for each trial (I have 5 reps for now in my loop).
What did you try to make it work?:
I have already tried to set randint(5,10) within the duration box in the builder.
I also tried to do something similar in the code:
stimulus_interval = randint(5,10)
In those cases I got the random value selected between 5 and 10 (i.e. 8 sec) but it is always the same for each trial (so that in each trial the duration of my routine is fixed to 8 secs)
I’ve also tried with the custom (Begin Routine) by inserting:
(in this case I got this error message:
TypeError: unsupported operand type(s) for +: ‘float’ and ‘list’
What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.