【发布时间】:2012-09-05 18:17:24
【问题描述】:
我想使用subprocess 格式化驱动器,并让 windows 命令提示符弹出来查看结果,但是这样做时:
subprocess.Popen(["FORMAT", drive, "/FS:FAT32", "/A:32K"], shell=True).communicate()
我得到这个错误:
WindowsError: [Error 2] The system cannot find the file specified
有什么帮助吗?
【问题讨论】:
-
你需要
shell=True我相信 -
哦,我的错,写这个的时候打错了...编辑...
-
尝试使用它的真实姓名,也许(format.com)
标签: python windows batch-file subprocess