should these be fixed for python 2.4?
Steve Holden
steve at holdenweb.com
Sat Oct 2 22:58:20 EDT 2004
Andrew Dalke wrote:
> 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.
>
"l" is a list of arguments and "v" is a variable number - which of
course in C requires a varargs signature.
To support your contention that they aren't easy to use, I had to look
them up in the docs (which I did to improve my mind (which could use
some improvement, believe me))
regards
Steve
--
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119
More information about the Python-list
mailing list