How to timeout when waiting for raw_input from user ?

Rune Strand rune.strand at gmail.com
Sat Dec 5 09:11:58 EST 2009


On Dec 5, 3:07 pm, Maxim Khitrov <mkhit... at gmail.com> wrote:
>
> Doesn't work on Windows.
>
> - Max

Yes, it does. I've used it a lot, also in Py2Exe apps.  Try the
documentation example yourself

def hello():
    print "hello, world"

t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed





More information about the Python-list mailing list