Problem with unpack hex to decimal

serpent17 at gmail.com serpent17 at gmail.com
Sun Apr 17 14:37:48 EDT 2005


Hello,

I was looking at this:
http://docs.python.org/lib/module-struct.html
and tried the following

>>> import struct
>>> struct.calcsize('h')
2
>>> struct.calcsize('b')
1
>>> struct.calcsize('bh')
4

I would have expected

>>> struct.calcsize('bh')
3

what am I missing ?

Thanks in advance,

Jake.




More information about the Python-list mailing list