问题1.调用subprocess.Popen时挂住不动了
调用subprocess.Popen时,如下,使用stdout=subprocess.PIPE,如果输出过大,会导致进程挂住
p = subprocess.Popen(smd_client + '%s' % msgFile, shell=True, stdout=subprocess.PIPE)
p.wait()
本文探讨了使用Python的subprocess.Popen模块时遇到的一个常见问题:当stdout参数设置为subprocess.PIPE且输出数据量过大时,可能会导致子进程挂起不动。文章提供了具体的代码示例并分析了解决该问题的方法。
问题1.调用subprocess.Popen时挂住不动了
调用subprocess.Popen时,如下,使用stdout=subprocess.PIPE,如果输出过大,会导致进程挂住
p = subprocess.Popen(smd_client + '%s' % msgFile, shell=True, stdout=subprocess.PIPE)
p.wait()

被折叠的 条评论
为什么被折叠?