How can I use struct.unpack()
or some other function available in Python to easily convert one byte variable to a Python integer? Right now, it is done in a rather lame way:
file = open("telemetry.dat", "rb").read()
magic = file[0]
int(binascii.hexlify(magic), 16)
Is there another?