Hi Nike,
Sorry, I should have elaborated more. I meant to put the whole expression:
$"%.1fs %i/20" % (40 - loopClock.getTime(), trialPairNumber)
inside the text box of a text component--but changing the variable
names to match your situation. Lets go through all of this in more
detail.
The first part "%.1fs %i/20" is just to format the numbers (%.1f
gives you 1/10th of a second, %.0f would give to the nearest second,
no fractional part) and the second part is the time and count info.
But you'll have to replace those variable names with ones that you
specify. We'll get to those below. The $ means "interpret this whole
text box as being python code". The whole thing goes in the text box
(no code components yet, only a text component.)
Call you loop "trials" (no quotes), then you can use "trials.thisRepN"
instead of "trialPairNum" above. (If you call it something else,
replace "trials" with your loop name.) You need to define your own
loopClock in a code component. So add a code component in a new
routine that you place just before the "trials" loop. It should be
outside the loop, not inside. In the code component, in the End
Routine box, put this line of code:
timer = core.CountdownTimer()
timer.add(40)
If you do this, then back in the text box, the exact code to put (in
the text box, not a code component), is:
$"%.1fs %i/20" % (timer.getTime(), trials.thisRepN)
Be sure to set that text box to update every frame.
--Jeremy
>
https://groups.google.com/d/msg/psychopy-users/-/8C2p548NH7cJ.