I have two variables of the class bytes
in python3.
print(string1) --> b'2900BCE03604093C000080'
print(bytes.fromhex(string1.decode('utf8'))) --> b')\x00\xbc\xe06\x04\t<\x00\x00\x80'
print(type(string1)) --> <class 'bytes'>
print(type(bytes.fromhex(string1.decode('utf8')))) --> <class 'bytes'>
The strange values in the second output are there because of ascii interpretation of some hex-values.
My Question is how to convert the string1
more easily to the output of the second line. Is there a better way?