我试图让一个脚本的输出,它使用Python的subprocess.Popen
喜欢如下Python的POPEN()。stdout.read()挂
process = Popen(command, stdout=PIPE, shell=True)
exitcode = process.wait()
output = process.stdout.read() # hangs here
它挂在第三行,只有当我运行它作为一个python脚本,我不能在python shell中重现这一点。
其他脚本只显示几个字,我假设它不是缓冲区问题。
有没有人知道我在做什么错在这里?
如果你在'command'手动执行命令,它会产生输出吗? –