I have a problem with hex conversion in Python.
I have a string that represents the hexadecimal number - "02" , and I want to convert it to 0x02 and append it to another hexadecimal number.
My code is:
valToWrite1 = '\x3c' valToWrite2 = '02'
I want to join these two values so that my result is "\x3c\x02" . It is important to keep leading zeros.
source share