0

I want to change unicode to hex bytes.

How to deal with that?

I use windows 7 and python 2.7. I have tried unhexlify() but error occurs: TypeError: Non-hexadecimal digit found

bd_addr = u'EW2FB9123456'
SN_write = b'\x32\xD3\x0D\x02' + unhexlify(bd_addr) + struct.pack("<H", 
 CRC16.calc(b'\x32\xD3\x0D\x02' + unhexlify(bd_addr)))
Bill
  • 33
  • 7

0 Answers0