By default, C types are represented in the native machine format and byte order and are correctly aligned by skipping the missing bytes, if necessary (in accordance with the rules used by the C compiler).
In the unpacking, it is assumed that the float will be aligned on an 8-byte boundary and will skip more than 1 byte of filling to get there. You can confirm this by skipping 1 byte yourself:
>>> struct.unpack_from('1sxHxbxf', a) ('9', 255, 10, 2.8355782166755716e-09) >>> struct.unpack_from('f',a[8:]) (2.8355782166755716e-09,)
To disable alignment, add = , < , > or ! to the beginning of the format string ,
>>> struct.unpack_from('=1sxHxbxf', a) ('9', 255, 10, 110.01000213623047)
source share