how to kill subprocess when Python process is killed?

2009-08-06 Thread mark.v.we...@gmail.com
I am writing a Python program that launches a subprocess (using Popen). I am reading stdout of the subprocess, doing some filtering, and writing to stdout of the main process. When I kill the main process (cntl-C) the subprocess keeps running. How do I kill the subprocess too? The subprocess is li

Re: how to kill subprocess when Python process is killed?

2009-08-07 Thread mark.v.we...@gmail.com
On Aug 7, 12:57 am, alex23 wrote: > On Aug 7, 3:42 pm, "mark.v.we...@gmail.com" > wrote: > > > When I kill the main process (cntl-C) the subprocess keeps running. > > How do I kill the subprocess too? The subprocess is likely to run a > > long time. > >