[Tutor] gzip

questions anon questions.anon at gmail.com
Sun Aug 7 02:52:02 CEST 2011


Hi All,
I am trying to decompress at gzipped netcdf file and place the decompressed
file in the same folder without the *.gz extension. I am using gzip. If I
use the following code nothing happens.

import gzip
filepath="D:/test/surfacetemp.nc.gz"
compresseddata=gzip.open(filepath, "rb")
file_content=compresseddata.read()

How can I output the decompressed file? something like:
output=file_content.write(filepath[:-3])

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110807/b0ada983/attachment.html>


More information about the Tutor mailing list