Re: subprocess pipe question

2011-02-25 Thread Rita
The results look right! I did a rather large test and the checksum passed. I will hold off any speed ups as you suggested. On Wed, Feb 23, 2011 at 8:37 PM, Rob Williscroft wrote: > Rita wrote in > news:AANLkTi=88dcpm_kqrs2g620obsnxz0majubfwpeme...@mail.gmail.com in > gmane.comp.python.general:

Re: subprocess pipe question

2011-02-23 Thread Rob Williscroft
Rita wrote in news:AANLkTi=88dcpm_kqrs2g620obsnxz0majubfwpeme...@mail.gmail.com in gmane.comp.python.general: [Top post relocated] > On Tue, Feb 22, 2011 at 7:57 PM, Rob Williscroft > wrote: > >> Rita wrote in >> news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in >> gmane.co

Re: subprocess pipe question

2011-02-23 Thread Rita
This is a good solution thanks. You should wiki this somewhere. For extra points is there a way to speed up the p.stdout.read(bufsize) ? On Tue, Feb 22, 2011 at 7:57 PM, Rob Williscroft wrote: > Rita wrote in > news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in > gmane.comp.

Re: subprocess pipe question

2011-02-22 Thread Rita
Thanks everyone for your replies. Chris, Unfortunately, I can't redirect the output to a file because there are other processes which use this processes output as stdin. Rob, I will give this a try. On Tue, Feb 22, 2011 at 7:48 PM, Chris Kaynor wrote: > > On Tue, Feb 22, 2011 at 3:44 PM, Rita

Re: subprocess pipe question

2011-02-22 Thread Rob Williscroft
Rita wrote in news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in gmane.comp.python.general: > > When using wait() it works a bit better but not consistent > def run(cmd): > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > rc=p.wait() > print rc > return p.stdout > > W

Re: subprocess pipe question

2011-02-22 Thread Chris Kaynor
On Tue, Feb 22, 2011 at 3:44 PM, Rita wrote: > I have a process like this, > > def run(cmd): > #cmd=a process which writes a lot of data. Binary/ASCII data > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > > I would like to get cmd's return code so I am doing this, > > def run(cmd): > p=su

Re: subprocess pipe question

2011-02-22 Thread GMail Felipe
On 22/02/2011, at 20:44, Rita wrote: > I have a process like this, > > def run(cmd): > #cmd=a process which writes a lot of data. Binary/ASCII data > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > > I would like to get cmd's return code so I am doing this, > > def run(cmd): > p=subpro

subprocess pipe question

2011-02-22 Thread Rita
I have a process like this, def run(cmd): #cmd=a process which writes a lot of data. Binary/ASCII data p=subprocess.Popen(cmd,stdout=subprocess.PIPE) I would like to get cmd's return code so I am doing this, def run(cmd): p=subprocess.Popen(cmd,stdout=subprocess.PIPE) rc=p.poll() print