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)
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
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
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