#coding=utf-8
from struct import pack,unpack

byte=pack('f',1.5)
print(byte)
print([i for i in byte])

byte=pack('f',123432.523424)
print(byte)
print([i for i in byte])

输出

b'\x00\x00\xc0?'
[0, 0, 192, 63]
b'C\x14\xf1G'
[67, 20, 241, 71]

 

相关文章:

  • 2022-12-23
  • 2021-08-09
  • 2021-10-15
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2022-12-23
相关资源
相似解决方案