another with execlp

Sylvain Thenault syt at pegasus.logilab.fr
Wed Sep 12 03:02:49 EDT 2001


On 11 Sep 2001 18:06:39 GMT, Donn Cave <donn at u.washington.edu> wrote:
>Quoth syt at pegasus.logilab.fr (Sylvain Thenault):
>
>| I want to fork a process an exec python inside
>| I have tried
>|
>| if os.fork() == 0:
>|     os.execlp('python', 'myfile.py', 'myoption1', 'myoption2', 'myoption2value')
>| else:
>|     os.wait()
>|
>| but i obtain
>|
>| Unknown option: --
>|
>| from the python interpreter (and not from myfile.py)
>
>Try os.execlp('python', 'python', 'myfile.py', ...)
>
>The argument list starts at 0, not 1.
>
>	Donn Cave, donn at u.washington.edu


it works, thanks for your help

-- 
Sylvain Thenault

LOGILAB




More information about the Python-list mailing list