我刚刚注意到我用 python 2.5 编写的旧代码现在不起作用。我在 python 2.6 顺便说一句。
>>> os.spawnl(os.P_NOWAIT,"setup.exe")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python26\lib\os.py", line 612, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument
>>>
有什么线索吗?或者您是否有任何带有 NOWAIT 选项的 os.spawn* 工作样本。
更新:
即使我将完整路径放在 os.spawnl() 中,它仍然是错误的。