Best Way to refer to a different Excel file each new trial

OS (e.g. Win10): WIn10
PsychoPy version (e.g. 1.84.x): v2020.2.5
**Standard Standalone? yes
I have one routine (let’s call it example) under a loop (inner) that pulls from a .xlsx file for two parameters (Word, Time), which are a sequential list of words with a specific display duration for each one. What I am looking to do is have a loop (outer) over top of “example”, “inner”, fixation cross, and response screen that randomly selects a .xlsx file from within a folder to designate what string of words and corresponding display times. However, I am unfamiliar with implementing sections of custom coding into the psychopy builder, and using a folder explorer function. My previous experiments were just hard-coded in pycharm and imported to psychopy. If I were to do it with just coding, I’d use a tuple of some kind. But when it comes to implementing sections of coding, I am not sure.

Thanks in advance.

Have the outer loop point to an Excel file containing a column of file names. Have the inner loop point to that column name preceded by a dollar sign.

1 Like

Ya I realized that shortly after. It didn’t occur to me at first because in our lab (maybe it was of the older version we were running at the time, or it was just senior staff did it one way) there was a custom coded segment that did this. Thanks though!

I often use code to do this job for versatility but the spreadsheet of spreadsheets method is more transparent.