i have a python hexadecimal like this:
variable = b'\x80pu\xa6\x7f\xfe\xb9\x1d\xaf'
in python 2 if i do variable[0] i get '\x80' but in python 3 it converts into int for me and it return 128.
i guess i can try to convert the answers back to hexadecimal like this:
hex(variable[0])
but its a whole array and i might not be integers. i was looking for a better way to do this since:
hex() takes only integer and also it returns a string not the hexadecmial version
i want the actual x80 not 128
how would i do this?
code i am working with:
p = b'\x80pu\xa6\x7f\xfe\xb9\x1d\xaf'
f = struct.unpack('>B', p[0])[0]
TypeError: a bytes-like object is required, not 'int'
it works in python2 but not in python 3