Description of the problem: I am looking for a way to use the output of an Experiment Info within a csv file for conditions in a trial loop. My expInfo is “Gruppe” (group) that can have values from 1 to 8.
What I tried so far: I generated a total of 8 csv files that include different videos according to the group. The names of the csv files simply are:
group1.csv
group2.csv
group3.csv
…
group8.csv
In the conditions line within the loop it says: ‘group’ + str(expInfo[‘Gruppe’]) + ‘.csv’
However, I always get an error that the conditions file cannot be found but I don’t know whats the matter… I first tried it without the str(), but it didn’t work either. I just thought it makes more sense this way, since my groups are defined as numbers from 1 to 8.
with a $ it is working! Thank you so much! I didn’t think about a $, because I thought it only needs to be used with variables that are, e.g., in a csv sheet! But that’s great,thanks for the quick response!
Have a great day!
while your solution works perfektly within the builder, I have a problem when I try to synchronize it with Pavlovia…
I get the following error:
Traceback (most recent call last):
File “c:\users\eplog\anaconda3\lib\site-packages\psychopy\experiment_experiment.py”, line 829, in findPathsInFile
filePath = eval(filePath)
File “”, line 1, in
NameError: name ‘expInfo’ is not defined
As soon as I remove the conditions line ($‘group’+expInfo[‘Gruppe’]+’.csv’), the synchronization works again… Do you have an idea what to do about it?