Chinaunix
标题:
请问os.popen("netstat -rn")老是执行错误
[打印本页]
作者:
looneyxp
时间:
2010-01-11 15:23
标题:
请问os.popen("netstat -rn")老是执行错误
C:\>python
ActivePython 2.5.4.4 (ActiveState Software Inc.) based on
Python 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.popen("netstat -rn")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
WindowsError: [Error 123] : 'C:\\WINDOWS\\system32\\cmd.exe;C:\\Program Files\\G
raphviz2.24\\bin /c netstat -rn'
>>>
问题是我都卸载了Graphviz2.24而且在cmd下输入path看到环境变量里面没有它啊
作者:
int32
时间:
2010-01-11 15:45
重新开一个命令行,查看下PATH里是不是还有这个路径
作者:
looneyxp
时间:
2010-01-11 16:02
问题解决了,原来是没有清理干净,在COMSPEC环境变量里面还存在;C:\Program Files\G
raphviz2.24\bin ,而COMSPEC 指明DOS command.com文件存在的目录
作者:
Mylib
时间:
2010-01-12 16:45
改成 os.system 就OK了
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2