Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created August 10, 2012 23:31
Show Gist options
  • Save mitsuhiko/3318947 to your computer and use it in GitHub Desktop.
Save mitsuhiko/3318947 to your computer and use it in GitHub Desktop.
>>> e = codecs.lookup('zlib').incrementalencoder()
>>> e.encode('foo')
'x\x9c'
>>> e.encode('bar')
''
>>> e.encode('baz')
''
>>> e.encode('', final=True)
'K\xcb\xcfOJ,JJ\xac\x02\x00\x12{\x03\xb7'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment