python 16进制转字符串

>>> import struct
>>> recv_date = b'\xba\xe7\x26\x3b\xa1\x33\xc9\xb1\x56\xdb\xce\xd9\x74\x24\xf4'
>>> A=struct.unpack(str(len(recv_date))+'B', recv_date)
>>> print(A)
(186, 231, 38, 59, 161, 51, 201, 177, 86, 219, 206, 217, 116, 36, 244)
>>> chr(86)

你可能感兴趣的:(python)