在 Python 3中 :
>>> import struct>>> struct.unpack('!f', bytes.fromhex('41973333'))[0]18.899999618530273>>> struct.unpack('!f', bytes.fromhex('41995C29'))[0]19.170000076293945>>> struct.unpack('!f', bytes.fromhex('470FC614'))[0]36806.078125在 Python 2中 :
>>> import struct>>> struct.unpack('!f', '41973333'.depre('hex'))[0]18.899999618530273>>> struct.unpack('!f', '41995C29'.depre('hex'))[0]19.170000076293945>>> struct.unpack('!f', '470FC614'.depre('hex'))[0]36806.078125


