Need to create subprocess...

Patrick Maupin pmaupin at
Thu Mar 18 18:30:01 CET 2010

On Mar 18, 11:17 am, "drstoka" <filip.popravi.stojmeno... at>
> Hello,
> I have to run a program as a child process inside my python program and
> redirect it's output through a pipe to a parent program process.
> So, I wrote this:
> pipe = Popen('example_program', shell=True, bufsize=0, stdout=PIPE).stdout
> and it works great.
> Now, in parent program I need to wait for a some time and if a child
> (example_program) does not finish in that time, kill the child.
> How do I do that? Please help.

I have a module that does this and more, but it only works on Linux:

For usage examples, you can just execute it.  Also, see in
the same directory.


More information about the Python-list mailing list