[英]Python: the system cannot find the file specified using subprocess.Popen
The entirety of my script: 我的整个脚本:
#!/bin/env python
import subprocess
p = subprocess.Popen(["/bin/bash", "-i", "-c", "C:\\xampp\\xampp_stop.exe"])
stdout, stderr = p.communicate()
This results in: WindowsError: [Error 2] The system cannot find the file specified
结果导致: WindowsError: [Error 2] The system cannot find the file specified
However, C:\\xampp\\xampp_stop.exe
does exist 但是, C:\\xampp\\xampp_stop.exe
确实存在
Any suggestions? 有什么建议么? I'm new to python, so I suspect it's something very, very obvious. 我是python的新手,所以我怀疑它非常非常明显。
It's actually bash
that the system can't find. 它实际上是bash
,该系统无法找到。 Windows doesn't come with bash
. Windows不附带bash
。 Remove it and its arguments and just call xampp_store.exe
. 删除它及其参数,然后调用xampp_store.exe
。
#!/bin/env python
import subprocess
p = subprocess.Popen(["C:\\xampp\\xampp_stop.exe"])
stdout, stderr = p.communicate()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.