我有 2 个模块 test1.py 和 test2.py,它们都位于 c:/python27 下,从 test1.py,我试图调用 test.py,如下所示,但出现错误。
测试1.py
import subprocess
print 'Im in module-1'
subprocess.Popen('c:/python27/test2.py')
测试2.py
print 'Im in module-2'
错误:-
C:\Python27>python test1.py
Im in module-1
Traceback (most recent call last):
File "test1.py", line 4, in <module>
subprocess.Popen('c:/python27/test2.py')
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application