[Tutor] How to only give the user so much time to enter response?
jimcarnell at yahoo.com
Sun Mar 15 09:22:00 CET 2009
Trying to use Timer in console based game that gives the user so much time to act. If they do not act then it just passes the turn back to the program to do the next thing. I have Python 2.5 and Windows XP.
print "hello, world"
t = Timer(30.0, hello)
TypeError:__init__() takes exactly 2 arguments (3 given)
Also tried this, but I think it might be outdated. When I type it
in it never triggers the function.
so... this kind is where I am:
newMove = 5 #5 = player will stay in same position on 2d array
newMove = int(raw_input("Move 1-9 / 0 to quit:"))
It works, but I am guessing it isn't a very good way to do it.
I am curious why I can't get anything to work from the docs.
Any help appreciated (and hopefully yahoo won't butcher my indentation).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor