【发布时间】:2014-06-30 13:53:39
【问题描述】:
下面的代码完全可以正常工作。但是,一旦调用子进程并执行外部 python 脚本,它就会开始快速弹出命令提示符,因为脚本的输出是纯文本。但是,我们已尽一切努力禁用该弹出窗口。我们尝试添加“shell=False”和“shell=None”。我们甚至尝试编辑外部脚本本身并修改其子进程调用,但它没有。
if os.path.exists(oldpath): shutil.copy(root.wgetdir + "\\" + root.website.get() + "\\" + item, keyworddir + "\\" + item)
shellreturn = subprocess.check_output(["C:\Python34\python",root.wgetdir + "\html2text.py", keyworddir + "\\" + item])
print(shellreturn)
shelllist = shellreturn.decode().splitlines()
【问题讨论】:
标签: python shell subprocess latency