On 06/01/2012 02:14, random joe wrote:
On Jan 5, 7:27 pm, MRAB<pyt...@mrabarnett.plus.com>  wrote:

 I've found that if I gunzip it twice (gunzip it and then gunzip the
 result) using the gzip module I get the text file.

On a windows machine? If so, can you post a code snippet please?
Thanks

import gzip

in_file = gzip.open(r"C:\2012-January.txt.gz")
out_file = open(r"C:\2012-January.txt.tmp", "wb")
out_file.write(in_file.read())
in_file.close()
out_file.close()

in_file = gzip.open(r"C:\2012-January.txt.tmp")
out_file = open(r"C:\2012-January.txt", "wb")
out_file.write(in_file.read())
in_file.close()
out_file.close()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to