How can I kill a running thread when exiting from __main__

Steve Holden steve at
Tue Apr 3 19:50:18 CEST 2007

skip at wrote:
>     Steve> The only way to do this is to have the thread regularly examine a
>     Steve> "please quit" flag that is set from the main thread when
>     Steve> termination is required.
> I thought the process would terminate when only daemon threads were left.
> Skip

So it does - according to the documentation. In which case why is the OP 
asking the question, since his code sets the queuethread daemonic before 
starting it?

Maybe, then, the real answer is "just exit from the main thread"?

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd
Skype: holdenweb
Recent Ramblings

More information about the Python-list mailing list