Timothy Crone wrote:
>header = "s"
>data = list(unpack(header,f.read(1)))
>
>however this:
>
>header = "si"
>data = list(unpack(header,f.read(5)))
>
>throws
>
>struct.error: unpack requires a string argument of length 8
>
>So unpack expects 7 additional bytes when an integer is added to the
>form
On Jul 19, 12:34 am, Timothy Crone wrote:
> Hello,
>
> I have noticed that for certain format strings, struct.unpack expects
> the wrong number of bytes.
[snip]
> header = "si"
> data = list(unpack(header,f.read(5)))
>
> throws
>
> struct.error: unpack requires a string argument of length 8
>
> So
Hello,
I have noticed that for certain format strings, struct.unpack expects
the wrong number of bytes. For example, this works fine
header = "4si4s4si2h2i3h4s"
data = list(unpack(header,f.read(42)))
however, this
header = "4si4s4si2h2i3h4si"
data = list(unpack(header,f.read(46)))
returns the