thread, threading; how to kill a thread?

Kent Johnson kent3737 at yahoo.com
Wed Nov 17 13:05:23 EST 2004


Aaron Bingham wrote:
> There is no way to 'kill' a thread in Python.  You will need to do 
> something like
> 
> def timedLoop():
>    while not done:
>        time.sleep(10)
>        doSomething()

See this recipe for an example using a threading.Event as the flag:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65448

Kent



More information about the Python-list mailing list