How to start a process?

Dave Brueck dbrueck at
Tue Dec 12 15:33:43 CET 2000

Hi David,

The exec* routines _replace_ the current process with the new one, so this
doesn't really help you achieve the goal of several simultaneous processes.
See os.fork and the os.spawn* functions.

Anyway, if you use os.execvp you don't have to specify the full path to the
executable- it'll search your $PATH var for it. Also, the first (zero'th)
arg is the name of the program:



> Subject: How to start a process?
> I would like to start up a number of simultaneos processes
> from a Python
> script.  Can someone explain or refer me to a document that explains
> what is going on below.  As a test I am executing a script ''.
> Why do I get this OSError when I try using execv, but it runs
> when I use
> 'execfile'?
> Thanks in advance.
> david lees
> >>> execfile('')
> foo to you charlie
> more hacks
> >>> os.execv('e:\python20\',['foo','bar'])
> Traceback (innermost last):
> File "<interactive input>", line 1, in ?
> OSError: [Errno 8] Exec format error
> >>>
> --

More information about the Python-list mailing list