Re: Issue combining gzip and subprocess

2009-07-22 Thread Scott David Daniels
Piet van Oostrum wrote: ... f = gzip.open(filename, 'w') proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if not line: break f.write(line) f.close() Or even: proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE)

Re: Issue combining gzip and subprocess

2009-07-22 Thread Piet van Oostrum
Scott David Daniels scott.dani...@acm.org (SDD) schreef: SDD Piet van Oostrum wrote: ... f = gzip.open(filename, 'w') proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if not line: break f.write(line) f.close() SDD Or even: SDD

Issue combining gzip and subprocess

2009-07-21 Thread Iwan Vosloo
Hi there, We tried to gzip the output of a shell command, but this results in a strange error: the resulting file seems to be the concatenation of the plaintext file with the zipped content. For example: f = gzip.open(filename, 'w') subprocess.check_call(['ls','-la'], stdout=f) f.close() Using

Re: Issue combining gzip and subprocess

2009-07-21 Thread Piet van Oostrum
Iwan Vosloo i...@reahl.org (IV) wrote: IV Hi there, IV We tried to gzip the output of a shell command, but this results in a IV strange error: the resulting file seems to be the concatenation of the IV plaintext file with the zipped content. IV For example: IV f = gzip.open(filename, 'w') IV