threading question

Thomas Heller thomas.heller at ion-tof.com
Thu Apr 13 13:00:42 EDT 2000


I want a thread to run in parallel with the interactive
interpreter.
Simple:

def do_work():
    import time
    while 1:
        time.sleep (1)
        ...

import threading
threading.Thread (target=do_work()).start()

But when I hit EOF, python waits until this thread is finished.
How can I avoid this? I want python to terminate the thread
and exit in this case.

Thomas Heller






More information about the Python-list mailing list