I know that to convert from int
to bytes
you have to do this, for example:
>>>a = bytes(4)
>>>print(a)
b'\x00\x00\x00\x00'
But what do I do if I want to revert it and convert bytes
to int
or float
?
I tried using:
int.from_bytes( a, byteorder='little')
and
int.from_bytes( a, byteorder='big', signed=True)
but it did not work.