我正在使用python运行外部程序,如下所示
call("/usr/sbin/snif")
我得到
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/subprocess.py", line 480, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
我如何得到最后一行,上面写着:
“没有相应的文件和目录”
或者更好的是,我怎么知道执行是否成功?
谢谢