Jun-13-2018, 11:58 AM
Hello,
I would like to assign hex values to a byte array, however for some values python assign letters to the array instead hex values.
For example:
Best regards,
Olli
I would like to assign hex values to a byte array, however for some values python assign letters to the array instead hex values.
For example:
length = bytes(3) barray = bytearray(length) # construct example array barray[0] = 0xd0 barray[1] = 0x13 barray[2] = 0x74 print(barray)It outputs:
bytearray(b'\xd0\x13t')But I would like to have:
bytearray(b'\xd0\x13\x74')Where is the problem?
Best regards,
Olli