Reading binary data

Aaron Scott aaron.hildebrandt at gmail.com
Wed Sep 10 14:12:01 EDT 2008


Sorry, I had posted the wrong error. The error I am getting is:

     struct.error: unpack requires a string argument of length 12

which doesn't make sense to me, since I'm specifically asking for 11.
Just for kicks, if I change the line to

     print struct.unpack('3sII', file.read(12))

I get the result

     ('GDE', 33554432, 16777216)

... which isn't even close, past the first three characters.



More information about the Python-list mailing list