Hi, I am totally new to PsychoPy, and coding in general (this is day 3). This is what I want to do:
Participants see a sequence of photographs. They move through the sequence with a key press, and the reaction time to each photograph is recorded.
The problem is that the photographs are specific to each individual participant, so the files will have different names every time I run the experiment. I can’t find any information about how to read a sequence of files from a specified folder - not sure if I’m using the wrong search terms though.
I’ve been trying to build up the code bit-by-bit, and I’ve got to here, specifying a single photo to present:
from psychopy import core, visual, event, clock win = visual.Window(fullscr=True,allowGUI=True) img = visual.ImageStim(win, 'G0020132.JPG', size = 1.5, flipVert=False) kb = keyboard.Keyboard() timer = core.Clock() img.draw() win.flip() continuing = True while continuing: timer.reset() kb.clock.reset() key = event.waitKeys() rt = timer.getTime() core.wait(0.001) # make sure event was processed by ptb too print(key) print(rt) if key == 'q': continuing = False
I’m now stuck. I’ve seen posts about reading from a csv file, but this would be a pain in the present situation as the files are different for each participant. Any help on demos, search terms, examples, etc. would be very much appreciated! Thanks