Reading a Bitstream

Patrick Maupin pmaupin at
Wed Nov 19 03:10:02 CET 2003

Dietrich Epp wrote:

> Are there any good modules for reading a bitstream?  Specifically, I 
> have a string and I want to be able to get the next N bits as an 
> integer.  Right now I'm using struct.unpack and bit operations, it's a 
> bit kludgy but it gets the right results.

As Miki wrote, the array module will probably give you what
you want more easily than struct.unpack.  If you need more
help, just post a few more details and I will post a code
snippet.  (As to the rest of Miki's post, I'm not sure that
I really want to know what an "Upnacker" is :)


More information about the Python-list mailing list