如何在python中运行dos命令?
这个问题在这里已经有了答案:
import subprocess
ch=subprocess.Popen("megarec.exe -cleanflash .1",shell=True,stdout=subprocess.PIPE,stderr=subrocess.PIPE)
output,err=ch.communicate()
if output:
print "success:",output
else:
print "error:",error
链接地址: http://www.djcxy.com/p/13501.html