Among other data is the sequence int, double, double, double

 struct.unpack('i3d', data[pos:pos + 4 + 3*8]) 

Mistake

 *** struct.error: unpack requires a bytes object of length 32 

Checking

 struct.calcsize('i') 4 struct.calcsize('3d') 24 struct.calcsize('i3d') 32 struct.calcsize('3di') 28 

What am I doing wrong?

  • And what is the length of data [pos: pos + 4 + 3 * 8]? - Vladimir Martyanov
  • @ VladimirMartyanov 28 - mkkik

1 answer 1

The order of bytes is probably forgotten, so he interprets how he wants

 >>> calcsize('<i3d') 28 >>> calcsize('<3di') 28