Zlib dictionary

Byron Morgan lazypointer at yahoo.com
Sat Jun 21 21:28:33 CEST 2003

I haven't used Zlib, but it looks as though it is at least somewhat

>>> import zlib
>>> data = {'Name':'Spam','Pet':'ex-Parrot'}
>>> dataz = zlib.compress(repr(data))
>>> eval(zlib.decompress(dataz))['Name']

Byron Morgan

"Miki" <janezgd at email.si> wrote in message
news:d75d795f.0306210032.238abe54 at posting.google.com...
> Hi
> Is it possible, with the Zlib library in Python, to compress some text
> data with a dictionary built on some other text? Is it possible to
> somehow access the dictionary after the compression and reuse it in
> another compression?
> Thanky you,
> Janez

More information about the Python-list mailing list