Im still new to python. Just wondering if there is an easier way to accomplish my task.
This is my current code
win = visual.Window([800,800],monitor="testmonitor", units="deg")
msg = visual.TextStim(win, text='hello this is a test',pos=[0,+1],color='white')
msg.draw()
win.flip()
core.wait(2)
msg = visual.TextStim(win, text='statement 1',pos=[0,+1],color='white')
msg.draw()
win.flip()
core.wait(2)
msg = visual.TextStim(win, text='statement 2',pos=[0,+1],color='white')
msg.draw()
win.flip()
core.wait(2)
msg = visual.TextStim(win, text='statement 3',pos=[0,+1],color='white')
msg.draw()
win.flip()
core.wait(2)
Is there a way I can pull statements from an excel file?
For example: I would have a loop going on and each round it would pull the next line in the file instead of having to copy the code and write a new statement each time?
xlrdfor actual Excel files or thecsvmodule for csv text files. You could also put all the strings in alist(or other container) and iterate over it.