由于无法避免的原因,我使用 Python 2.6。我在 Idle 命令行上运行了以下一小段代码,但遇到了一个我不明白的错误。我怎样才能解决这个问题?
>>> import subprocess
>>> x = subprocess.call(["dir"])
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
x = subprocess.call(["dir"])
File "C:\Python26\lib\subprocess.py", line 444, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python26\lib\subprocess.py", line 595, in __init__
errread, errwrite)
File "C:\Python26\lib\subprocess.py", line 821, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
>>>