#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])
输出
?? [‘\x00‘, ‘\x00‘, ‘\xc0‘, ‘?‘] C?G [‘C‘, ‘\x14‘, ‘\xf1‘, ‘G‘]
原文:https://www.cnblogs.com/sea-stream/p/10835156.html