Convert bytes to int?

Assuming you’re on at least 3.2, there’s a built in for this: int.from_bytes( bytes, byteorder, *, signed=False ) … The argument bytes must either be a bytes-like object or an iterable producing bytes. The byteorder argument determines the byte order used to represent the integer. If byteorder is “big”, the most significant byte is at the beginning of the byte array. If byteorder is “little”, the most significant byte is … Read more