How can I read 3 bytes as an integer?
Does struct module provide something like that?
I can read in 3 bytes and add an extra \\x00 and then interpret it as a 4-b
I think from 3.2, int developed a new method .from_bytes, so you're able to use the following instead of struct.unpack:
int
.from_bytes
struct.unpack
int.from_bytes(b'\x00\x00\x01', 'big') # 1
For reference, see: http://docs.python.org/dev/library/stdtypes.html#int.from_bytes