uncompress base64-gzipped string

Niels Egberts niels.egberts at gmail.com
Fri Jun 12 16:58:42 EDT 2009

I'm creating a game in python and I want to a level editor called
'tiled'. It ouputs a .xml file with base64-gzipped information. Then
every 4 bytes represents a number. See the following link:


To start I tried:
code = base64.b64decode("H4sIAAAAAAAAAO3NoREAMAgEsLedAfafE4+s6l0jolNJiif18tt/Fj8AAMC9ARtYg28AEAAA")
code = zlib.decompress(code)

But I get:
zlib.error: Error -3 while decompressing data: incorrect header check

How can I solve this?


More information about the Python-list mailing list