"Alexi Zuo" <alexi....@gmail.com> wrote:

> Hi everyone,
> 
> Here I have a simple program which starts a thread and the thread use
> Popen to execute a shell cmd which needs a long time.  I want to stop
> the thread once I type "ctrl+C" (KeyboardInterrupt). But in fact this
> program enters a dead loop. Can anyone tell me what is wrong?

The KeyboardInterrupt exception is being raised in your main thread which 
doesn't handle it so it just terminates. Your child thread isn't marked as 
a daemon thread so the program won't exit until the child thread has also 
terminated.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to