How to convert multiple bytes to floating point numbers in Python

1 Answer

0 votes
import struct

[x,y] = struct.unpack('ff', b'\xdb\x0fI@\x0b\x02I3')

print(x)
print(y)


'''
run:

3.1415927410125732
4.680081744368181e-08

'''

 



answered Jun 7, 2023 by avibootz
...