How to start a process?

Suchandra Thapa ssthapa at harper.uchicago.edu
Tue Dec 12 03:25:37 EST 2000


David Lees <DavidL at nonospamraqia.com> wrote:
>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 'hack.py'. 
>Why do I get this OSError when I try using execv, but it runs when I use
>'execfile'?
>
>>>> os.execv('e:\python20\hack.py',['foo','bar'])
>Traceback (innermost last):
>File "<interactive input>", line 1, in ?
>OSError: [Errno 8] Exec format error

    The first argument in the list should be the the program's name
e.g os.execv('e:\python20\hack.py', ['e:\python20\hack.py', 'foo', 'bar'])
on unix platforms. I believe that's also the case for windows but 
may be incorrect.  
    Also does your windows install know that it should feed files 
ending in .py to the python interpeter?  You may need to setup associations
between py files and the python interpeter.
    

-- 
------------------------------------------------------------------
			    |
Suchandra Thapa             | "There are only two kinds of math books. 
s-thapaNO at SPAMuchicago.edu  | Those you cannot read beyond the first 
			    | sentence, and those you cannot read 
			    | beyond the first page."
			    |                       -C.N. Yang
------------------------------------------------------------------



More information about the Python-list mailing list