I am trying to read a binary file (only 32 bits long) into a boolean array. It worked just fine when I followed:
Using Python How can I read the bits in a byte?
However, when I try to use the struct package I get a different results:
_fmt = '32?'
with open(filename, mode='rb') as fp:
content = struct.unpack(fmt, fp.read(struct.calcsize(fmt))
I would like to understand why.
Thanks