The encodings.zlib_codec Module

(New in 2.2) ZIP codec. Let’s you use the encode and decode string methods to compress and decompress data, instead of importing the zlib module (but note that the module lets you set more parameters, especially when compressing data).

compressed_data = data.encode("zlib")
decompressed_data = compressed_data.decode("zlib")

import zlib
compressed_data = zlib.compress(data)
decompressed_data = zlib.decompress(compressed_data)
 

[comment on/vote for this article]

A Django site. this page was rendered by a django application in 0.01s 2008-10-07 08:39:46.469932. hosted by webfaction.