equivalent to Tcl 'after' command?
Alan Gauld
alan.gauld at btinternet.com
Thu Apr 22 18:52:57 EDT 2004
On Thu, 22 Apr 2004 17:42:37 GMT, Mark Harrison <mh at pixar.com>
wrote:
> I'm writing some event-driven programs, and I would like
> to do the equivalent of the Tcl 'after' command, e.g.:
>
> after 1000 {puts "one second has elapsed"}
>
> 1. What's the most canonical way of doing this?
I suspect its to start a thread that in turn starts with
a sleep command. Not very pretty but approximately the same.
> 2. What's the best reference that talks about non-gui event loop
> programming in Python?
My book(paperversion only discusses them briefly but its hardly a
rference, more an intro to the convcept for beginners...
Its not quite the same as a pure event loop environment but you
could check out the cmd module for a text based command loop/menu
system. If you haven't already....
HTH,
Alan G.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Python-list
mailing list