Reputation: 3364
Unfortunately I don't understand the byte size calculation of the struct
python module.
I use this documentation when encoding my values.
import struct
struct.calcsize('H') # == 2
struct.calcsize('d') # == 8
but
struct.calcsize('Hd') # == 16 != 8+2
using the encoding together requires 16 bytes instead of 10
What could be/is the reason for this? Thanks!
Upvotes: 2
Views: 203
Reputation: 26
Maybe this can help; Python struct giving incorrect length
struct.calcsize('=Hd')
Upvotes: 1