Need to create subprocess...

Martin P. Hellwig martin.hellwig at dcuktec.org
Thu Mar 18 13:25:33 EDT 2010


On 03/18/10 16:17, drstoka wrote:
> 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.
>
>
Try searching around for "threading.thread python" it should give you 
some clues, if you can't work through the info (it can be a bit hard to 
digest), just post here an example of your test code along with what you 
expected and what didn't happen.

-- 
mph



More information about the Python-list mailing list