我在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()
Tags:
您需要的是关闭用作脚本标准输入的文件。
所以在你的情况下是
p.stdin.close()
。相关问题 更多 >
编程相关推荐