使用子時當試圖使用subprocess.check_output,我不斷收到此錯誤回溯:回溯錯誤在Python
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
subprocess.check_output(["echo", "Hello World!"])
File "C:\Python27\lib\subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
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 2] The system cannot find the file specified
這甚至發生在我嘗試:
>>>subprocess.check_output(["echo", "Hello World!"])
這恰好是文檔中的示例。
確定'在Windows echo'作品? – 2015-01-27 00:20:04
是的,回聲有效,但事實並非如此。它發生在子進程下的所有命令。 – user3806019 2015-01-27 00:23:15
相關(可能):http://stackoverflow.com/a/20335954/846892 – 2015-01-27 00:26:12