Timer

Anthony Briggs abriggs at westnet.com.au
Mon Oct 27 08:51:47 EST 2003


At 9:04 PM +0800 27/10/03, Derek Fountain wrote:
>Dave Harrison wrote:
>
>>>  > > Does Python have a timer mechanism? i.e. an "after 500 milliseconds,
>>>  > > run this bit of code" sort of thing?
>>
>>  why not just use the time.sleep() function ?
>
>Because that stops the thread. I want things to continue, and then be
>interrupted in order to execute a bit of code. Tcl has the 'after' command:
>
>after 5000 { set disabled 0 }
>
>The script carries on, and after 5 seconds whatever is being done gets
>interrupted in order to run a bit of script - in this case set a variable
>turning off a disablement of some sort.

Wow, that must make your scripts so much more interesting to debug ;)

Anthony
-- 
----------------------------------------------------
HyPEraCtiVE? HeY, WhO aRE YoU cALliNg HypERaCtIve?!
aBRiGgS at wEStNeT.cOm.aU
----------------------------------------------------





More information about the Python-list mailing list