Using Python How can I read the bits in a byte?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-05T02:57:27Z Indexed on 2010/04/05 3:03 UTC
Read the original article Hit count: 378

Filed under:
|
|

I have a file where the first byte contains encoded information. In Matlab I can read the byte bit by bit with var=fread(file,8, 'ubit1') then retrieve each bit by var(1),var(2), etc.

Is there any equivalent bit reader in python?

© Stack Overflow or respective owner

Related posts about python

Related posts about bits