Problem with running external process

Donn Cave donn at u.washington.edu
Tue Jan 24 18:18:14 CET 2006


In article <1138104394.859099.212220 at o13g2000cwo.googlegroups.com>,
 "ToMasz" <t_mo_info at o2.pl> wrote:

> No, no, that wasn't my intention (I'm just not conscious enough what's
> going on with these fork, exec, spawn.. functions).
> My parent process should start the child process and go back to it's
> tasks. Before executing it for the next time the parent should check if
> the previous child process is done and start it again.
> 
> Is it what these lines do?
> 
> os.spawnlp(os.P_NOWAIT,'ext_script.py','')
> os.waitpid(-1, os.WNOHANG)

No, do you see them doing it?  "Check if the previous child
process is done?"

In your original post you said you were using os.P_WAIT,
but I suppose you really were using os.P_NOWAIT all along,
right?

This case may call for a working sample program that makes a
genuine attempt to do what you want to do.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list