Python 16进制字节数组转字符串
2021-03-24 本文已影响0人
EricJun
bytes_object = [0xAA, 0xAB, 0x11]
w = " ".join("%02x" % b for b in bytes_object)
print(w)
输出结果:aa ab 11
bytes_object = [0xAA, 0xAB, 0x11]
w = " ".join("%02x" % b for b in bytes_object)
print(w)
输出结果:aa ab 11