I believe that signals are not available in Windows. This way, the signal module is not that much usefull. However, you can still catch the KeyboardInterrupt exception when Ctrl-C is pressed.
Now, it depends on what Python version you use to terminate the child. It should be easier with Python 2.6 -- see the snippet below. See the http://code.activestate.co
Main Topics
Browse All Topics





by: HonorGodPosted on 2009-08-06 at 17:09:27ID: 25039131
One possible solution:
- when child process is created, create a "watcher" process that know the processID of the child process, and the parent process.
- if the the parent process finished (e.g., is killed), then it can use the saved child process ID to kill it.