Python reference

Antonio Manuel Dias amdias at
Fri Jun 4 03:34:03 CEST 2004


Reiner Block wrote:
> import os
> os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')
> -----------------------------------------------------------------------
> The
> first says the first parameter is the mode like P_WAIT or P_NOWAITE. That's
> clear. But the second should be the program to start and the third...? :-( 

 From the python library reference:

The "l" variants are perhaps the easiest to work with if the number of 
parameters is fixed when the code is written; the individual parameters 
simply become additional parameters to the spawnl*() functions.

> It is not clear why the 2nd and 3rd parameter are the same.

In either case, the arguments to the child process must start with the 
name of the command being run.


Antonio Manuel Dias

More information about the Python-list mailing list