When I try to call this function in my program, it will call the error (in the title) if I take to long to run the program. It seems like over 5 minutes spent on the program will cause it to crash.
Windows 8 Python 2.7 Psychopy 1.82.02
def WaitForKeyInput():
timer= core.CountdownTimer(5)
trialClock.reset()
text='...'
#until return pressed, listen for letter keys & add to text string
while event.getKeys(keyList=['return'])==[]:
letterlist=event.getKeys(keyList=['0', '1', '2', '3', '4', '5' , '6', '7', '8', '9','backspace','q'])
color = 'black'
if timer.getTime() >= 3:
color = 'green'
elif timer.getTime() >=0:
color = 'yellow'
elif timer.getTime() <0:
color = 'red'
feedback = visual.Rect(mywin, width= 200,height = 200, pos = (0,-100), lineWidth=5.0, lineColor = color)
betAsk.draw()
feedback.draw()
response = visual.TextStim(mywin, height=36,text=text,color="white",pos=(0,-100))
if text != '...':
response.draw()
mywin.flip()
for l in letterlist:
if l == 'q':
core.quit()
#if key isn't backspace, add key pressed to the string
if l !='backspace':
if text =="...":
text=l
pressedkeys=l
else:
text+=l
pressedkeys+=(";" + l)
#otherwise, take the last letter off the string
elif len(text)>0:
text=text[:-1]
pressedkeys+=(";backspace")
event.clearEvents()