python 压缩解压缩

import bz2
import base64


message = '字典是python中唯一的映射类型'
unzip_string = bz2.compress(message)
a = base64.encodestring(unzip_string)
print a

c = base64.decodestring(a)
unzip_string = bz2.decompress(c)
print unzip_string
posted @ 2012-10-24 19:40  firesnow  阅读(312)  评论(0编辑  收藏  举报