I have psychopy v3.1.2.
I have my trials set up in a .csv file and everything works fine. I need to randomise the presentation of stimuli for each participant prior to experimentation, but unfortunately PsychoPy’s randomisation is not sufficient since I have to apply some restrictions. I have written some python code that imports the csv file using pandas and randomises it with my desired constraints, so everything is in place. I’m just wondering how best to apply it - I could run the code and output/overwrite the csv, and then run the experiment, but that feels a bit clunky to me. I haven’t really made much use of the coder view, but is it possible to paste in my code to there and have it execute each time the experiment runs?