I need to split a four digit string to two hexadecimal numbers.
Eg: string = "ABCD" expected output = 0xAB 0xCD
I tried these statements:
>>data = "0000"
>>[byte1, byte2] = [data[:2], data[2:]]
>>byteInt = int(byte1,16)
>>byteHex = format(byteInt,'0#4x')
>>print byteHex
I am getting the error, "ValueError: Invalid conversion specification" at the line "byteHex = format(byteInt,'0#4x')"