DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Using Gzip Module

09.02.2005
| 7245 views |
  • submit to reddit
        Modified from this funny thread in c.l.p
http://groups.google.co.uk/group/comp.lang.python/msg/e53361331c23fd76

import gzip

zfile = gzip.GzipFile('somefile.gz')
content = zfile.read()
zfile.close()