compress string of data

Piet van Oostrum piet at cs.uu.nl
Mon Jan 26 04:58:27 EST 2004


>>>>> Gerrit Holl <gerrit at nl.linux.org> (GH) wrote:

>> How i could compress string of data?.
>>>> import zlib
>>>> zlib.compress("Hello, world")
GH> 'x\x9c\xf3H\xcd\xc9\xc9\xd7Q(\xcf/\xcaI\x01\x00\x1b\xd4\x04i'

GH> http://www.python.org/doc/current/lib/module-zlib.html

Waw, that compresses it from 12 bytes to 20 bytes :=)
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list