Python子进程失败,错误为“ grep:写入错误:管道损坏”

时间:2018-12-17 11:26:03

标签: python-2.7 subprocess

我正在运行Python 2.6.6。我是python的新手。我执行命令失败。实际上,我想将每次迭代的输出存储在变量中。有人可以帮我吗。

RESULT = subprocess.Popen(("command @argument | grep -i 'Pattern'"), 
                          shell=True, stdout=subprocess.PIPE)

错误:grep: write error: Broken pipe

@argument每次循环的每次迭代都在变化。

0 个答案:

没有答案
相关问题