os.spawnl problem under windows...

Max nospam at nospam.nospam
Sun May 12 08:08:39 EDT 2002


I have a problem using the spawn functions under windows... i just can't
start anything!!!!

i did:
>>>import os
>>>os.spawnl(os.P_WAIT, 'c:\windows\notepad.exe', 'c:\windows\notepad.exe')
Traceback (most recent call last):
  File "<pyshell#23>", line 1, in ?
    os.spawnl(os.P_WAIT, 'c:\windows\notepad.exe', 'c:\windows\notepad.exe')
  File "C:\Python22\lib\os.py", line 530, in spawnl
    return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument
>>>

i tasted may flavours of the program's name ('notepad', 'notepad.exe',
'c:\windows\notepad.exe') both for the path parameter (second parameter) and
for the arguments (third parameter), always with the same results... :(
The 3rd parameter is required, i also tried '', and 'c:\autoexec.bat' (it
exists...) and 'c:\windows\notepad.exe c:\autoexec.bat', ...

I can't understand why it doesn't work, and how i can execute another
program from my Python script...
Thanks in advance for any suggestion...

Max





More information about the Python-list mailing list