如果我从cmd.exe
运行下面的命令,我得到的,看起来像这样的错误消息:为什么`subprocess.Popen`返回一个不同的输出到shell? - 视窗
C:\Users\user>ctaags --help
'ctaags' is not recognized as an internal or external command,
operable program or batch file.
现在,如果我使用Python的subprocess
模块运行相同的命令,我得到一个不同的警告:
>>> subprocess.Popen(['ctaags', '--help'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python27\lib\subprocess.py", line 711, in __init__
errread, errwrite)
File "c:\Python27\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
基于其他命令,我期望从Popen
输出完全匹配什么样的壳给我回来,即:
WindowsError: [Error 2] 'ctaags' is not recognized as an internal or
external command, operable program or batch file.
情况并非如此。为什么?
是否有理由在每个ctaa ... aags中有不同数量的a? – icedtrees
不是 - 现在修好了。 – stephenfin