os.spawn
Sylvain Thenault
syt at pegasus.logilab.fr
Wed Sep 12 05:13:58 EDT 2001
On 11 Sep 2001 18:05:13 GMT, Donn Cave <donn at u.washington.edu> wrote:
>Quoth syt at pegasus.logilab.fr (Sylvain Thenault):
>
>| how can I do for knowing what happend when I do an os.spawnv()
>|
>| for example, if i do
>|
>| import os
>| os.spawnv(P_WAIT, '/bin/echo', 'this is a spawn test')
>|
>| I can't see anything, and don't know what have been made...
>
>Normal return from os.spawnv should be 0. Anything else indicates
>failure.
>
> >>> print os.spawnv.__doc__
> spawnv(mode, file, args) -> integer
>
> Execute file with arguments from args in a subprocess.
>
>Args here should be a tuple or list like sys.argv:
> os.spawnv(os.P_WAIT, '/bin/echo', ('echo', 'this is a spawn test'))
>
> Donn Cave, donn at u.washington.edu
thanks, i was waiting for an exception in case of error
does someone know why it isn't the default behaviour ?
BTW, this wasn't working because as exec*, the first item of args must be
the called program's name ('echo' in this example)
--
Sylvain Thenault
LOGILAB
More information about the Python-list
mailing list