should these be fixed for python 2.4?

Andrew Dalke adalke at mindspring.com
Sat Oct 2 12:01:37 EDT 2004


Alexander Schmolck wrote:
>   ``os.run('touch', 'foo')`` [1]
> 
> vs.
> 
>   ``os.spawnvp(os.P_WAIT, 'touch', ['touch', 'foo'])``

I for one would rather use the first.  I know about the
spawn* functions but ...

> (Which spawn* is the
> right one? What does all that funny jargon in the docs mean? What were the
> right arguments again? Ooops, I forgot to pass the command I wanted to run as
> an argument... Finally -- what are the chances of getting all these right from
> memory?)

Bingo.  I'll add the above to my toolbox.  Even then I'll
need to figure out which of

os.spawnl    os.spawnlp   os.spawnv    os.spawnvp
os.spawnle   os.spawnlpe  os.spawnve   os.spawnvpe

to use.  Yes I know there's a mnemonic (p = path, e =
environment, v = something, l = something else) but I
forget them.

				Andrew "Joe Programmer"
				dalke at dalkescientific.com



More information about the Python-list mailing list