【发布时间】:2016-10-29 16:30:08
【问题描述】:
我正在制作一个可以使用 subprocess 和 tkinter 在命令提示符下执行的 GUI。
def test_subprocess(self):
proc = subprocess.Popen(["echo", "Hello"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True, shell=False)
response = proc.communicate()[0]
self.log.insert("end", response)
如果我设置shell=False,我会得到这个错误:
FileNotFoundError: [WinError 2] The system cannot find the file specified
我已经将参数分成了一个序列。
【问题讨论】:
标签: python cmd subprocess