2

I have a list of Hex value variables in my python code.

I need to convert into ASCII string.

Can someone please suggest to me, how to convert it?

HexList = ['0x0', '0x30', '0x32', '0x31', '0x30', '0x42', '0x32', '0x33', '0x38', '0x30', '0x30', '0x30', '0x31', '0x30', '0x32','0x43','0x30']

Expected value of Ascii string after the conversion= 0210B238000102C0

5
  • The output can be reproduced by doing something like ''.join(chr(int(c, 16)) for c in HexList[1:]) Commented Oct 7, 2019 at 9:57
  • 1
    Possible duplicate of Convert from ASCII string encoded in Hex to plain ASCII? Commented Oct 7, 2019 at 10:17
  • why did you start the index from 1 instead of 0 in HexList? Commented Oct 7, 2019 at 10:17
  • 0x0 doesn't do anything. Commented Oct 7, 2019 at 10:18
  • Specific duplicate answer: bytearray.fromhex("70 61 75 6C").decode() where 70 61 75 6C can be replaced Commented Oct 7, 2019 at 10:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.