如何用python将EOF写入STDIN popen
我通过popen运行了以下命令:如何用python将EOF写入STDIN popen,python,subprocess,popen,whiptail,Python,Subprocess,Popen,Whiptail,我通过popen运行了以下命令: p = subprocess.popen(["/usr/bin/whiptail", "--title", "\"Progress\"", "--gauge", "\"\"", "6", "50", "0"], stdout=subprocess.PIPE, stding=subprocess.PIPE) 要停止whiptail命令的运行,我需要将EOF发送到stdin 如何用Python将EOF发送到stdin 或者我只调用p.terminate()您需要的
p = subprocess.popen(["/usr/bin/whiptail", "--title", "\"Progress\"", "--gauge", "\"\"", "6", "50", "0"], stdout=subprocess.PIPE, stding=subprocess.PIPE)
要停止whiptail命令的运行,我需要将EOF发送到stdin
如何用Python将EOF发送到stdin
或者我只调用p.terminate()您需要的是关闭用作脚本标准输入的文件
所以在你的例子中,它是
p.stdin.close()
切向的,你真的想要Progress
用引号括起来——好像它不是真正的进步?