Piet van Oostrum wrote:
Scott David Daniels <scott.dani...@acm.org> (SDD) schreef:
...
SDD> Or even:
SDD>     proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE)
SDD>     with gzip.open(filename, 'w') as dest:
SDD>         for line in iter(proc.stdout, ''):
SDD>             f.write(line)

If it would work.

1) with gzip... is not supported in Python < 3.1
2) for line in iter(proc.stdout), i.e. no second argument.
3) dest <==> f should be the same identifier.

Lesson: if you post code either: - test it and copy verbatim from your test, or
- write a disclaimer

Totally chagrined and embarassed.
Chastisement absorbed and acknowledged.

--Scott David Daniels
scott.dani...@acm.org

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to