psychopy.org | Reference | Downloads | Github

Access variable in the conditions file of a loop

Hi,

I am wondering how I could access programmatically one of the variables in my conditions file. The hard part is that in the “Conditions” tab on my loop, I don’t have an .xlsx or .csv file but a variable ($condition) which I set at the beginning of the experiment and changes the xlsx. file based on participant’s ID.
So at the beginning of the experiment, I have something like this:

if int(expInfo['participant'])%2==0:
    condition='Exp1.xlsx'
else:
    condition='Exp2.xlsx'

Then on my trials loop, I have this condition variable at the Conditions tab, as shown below:
image

Now I want to have access to one of the columns in my Exp1.xlsx or Exp2.xlsx files. Then, I want to print which row of this column is active (or is displayed) at every given trial. Any ideas on how to do that?

1 Like