2009/6/30 superpollo <u...@example.net>: > Paul Moore wrote: >> For a non-toy example, you'd probably create an Event object, use your >> timer to set the event, and your while loop would do while >> event.is_set(), so the problem wouldn't arise. > > thank u paul. if u dont mind, would you give me a more detailed piece of > code that does what i mean?
No problem: import threading e = threading.Event() t = threading.Timer(3.0, e.set) t.start() while not e.is_set(): print "Hello, threading world" Hope this helps, Paul -- http://mail.python.org/mailman/listinfo/python-list