Code: Select all
# size of byte is 1
print(struct.calcsize('1b'))
1
# size of integer is 4
print(struct.calcsize('1I'))
4
# size of byte + integer should be 5, but got 8
print(struct.calcsize('1b1I'))
8
Code: Select all
# size of byte is 1
print(struct.calcsize('1b'))
1
# size of integer is 4
print(struct.calcsize('1I'))
4
# size of byte + integer should be 5, but got 8
print(struct.calcsize('1b1I'))
8
Code: Select all
print(struct.calcsize('<1b1I'))
5