timer

superpollo user at example.net
Tue Jun 30 15:06:10 CEST 2009


Paul Moore wrote:
> 2009/6/30 superpollo <user at 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

hi

while i was waiting 4 ur reply, i posted an almost equal example, but it 
does not work...



More information about the Python-list mailing list