Cleanly exiting multi thread application on SIGINT
fredrik at pythonware.com
Fri Mar 23 14:32:03 CET 2007
> Is the following the most elegant way to exit a multi-threaded
> application on a Ctrl-C? I am a complete beginner and would have
> thought there was some way of doing it without having to use while 1:
> pass, but have yet to find a way.
> def main:
> wt = workerThread()
> ct = counterThread()
> while 1:
you could at least insert a time.sleep(1), to avoid busy-looping.
More information about the Python-list