I’d like to insert the count of remaining trials in a text component of my loop. I tried to the following:
# Initialize components for Routine "Break_warmup" Break_warmupClock = core.Clock() break_wp_text = visual.TextStim(win=win, name='break_wp_text', text=u'Now you can take the break. \n Number of trials remaining:'+str(loop_warmup.nRemaining)+'/'+str(loop_warmup.nTotal), font=u'Arial', pos=(0, 0), height=0.1, wrapWidth=1.5, ori=0, color=u'white', colorSpace='rgb', opacity=1, depth=0.0);
However, I got the error:
NameError: name ‘loop_warmup’ is not defined
I do understand I can’t refer to
loop_warmup before defining it, but I was wondering if there is any way I could do this by keeping the text component where it is, especially because it also contain extra text.
Hope it is all clear. Thanks!