| Reference | Downloads | Github

How to set duration as a variable

Each trial in the experiment is performing a cue picture first,then a blank screen,and last a emotion picture.What I want is duration of blank screen can vary from 400ms to 600ms. I tried to input different duration in an excel.xlsx ,and input the variable name in duration column just like using other variables.However,it didn’t work.The error said ‘NoneType’ object is not callable.
Even I modified “condition.xlsx” file as “condition…csv” file according to results searched in this website.It was still wrong.
Can anybody give some suggestions please?

How are you currently trying to achieve this?

Personally I use random() or randint() but it sounded like you were setting it in the spreadsheet (to counterbalance?)

Exactly,I set them by using spreadsheet.

But it didn’t work.I guess duration isn’t different from other variables.
I also tried to use random().

It’s still wrong.Maybe I used it improperly.

I think the issue is that you are using variable names that PsychoPy is already using elsewhere. Try calling the column stimTime or similar.

Thank you.But it still doesn’t work.

The version of PsychoPy is v2020.2.10