Python 2.4.x这里。Subprocess - Grep Broken Pipe
一直试图让子进程与glob一起工作。
嗯,这是问题区域。
def runCommands(thecust, thedevice):
thepath='/smithy/%s/%s' % (thecust,thedevice)
thefiles=glob.glob(thepath + '/*.smithy.xml')
p1=subprocess.Popen(["grep", "<record>"] + thefiles, stdout=subprocess.PIPE)
p2=subprocess.Popen(['wc -l'], stdin=p1.stdout, stdout=subprocess.PIPE)
p1.stdout.close()
thecount=p2.communicate()[0]
p1.wait()
我在屏幕上收到大量的“grep:writing output:Broken pipe”错误。
这是一些简单的东西我错过了,我只是不能发现它。任何想法?
预先感谢您。
有一对夫妇身边子塔(非常漂亮)的包装会使你的生活更容易像[PBS](https://github.com/amoffat/pbs很多)和[plumbum](https://github.com/tomerfiliba/plumbum)。 –
那些看起来非常酷 - 不幸的是,我不是在一个环境中,我可以在2.4的模块之外添加模块 – Chasester