I have a value out of I²C register which is 2 bytes wide like 01C5 (as string). For my application, i have to swap high and low byte.
I tried it this way:
valueLow = hex(int(value,16) >> 8)
valueHigh = hex(int(value,16) & 0x0011)
but the results I get are now what they should look like.
Do you have a better solution?