Reading binary data

Jon Clements joncle at googlemail.com
Wed Sep 10 14:03:05 EDT 2008


On Sep 10, 6:45 pm, Aaron Scott <aaron.hildebra... at gmail.com> wrote:
> > CORRECTION: '3cII' should be '3sII'.
>
> Even with the correction, I'm still getting the error.

Me being silly...

Quick fix:
signature = file.read(3)
then the rest can stay the same, struct.calcsize('3sII') expects a 12
byte string, whereby you only really have 11 -- alignment and all
that...

Jon.



More information about the Python-list mailing list