I want to convert the byte string to hex for below variable.I want the result as DTCLogged[loopindex] = 0xDA
>>> DTCLogged[loopindex]
'DA'
After that it should satisfy the IF condition
if (DTCLogged[loopindex] & 0xC0)
How can I do it?
I want to convert the byte string to hex for below variable.I want the result as DTCLogged[loopindex] = 0xDA
>>> DTCLogged[loopindex]
'DA'
After that it should satisfy the IF condition
if (DTCLogged[loopindex] & 0xC0)
How can I do it?
Parse it as a hexadecimal integer:
x = int(DTCLogged[loopindex], 16) & 0xC0