My python script gets and sends words over a serial line. Each word is a signed 24-bit value, received as hex string. The script should now take these strings and convert them to integers, do some calculations on it, and send them back in the same format. My problem is, how to do this conversion
Examples
Rx string -> calc int
012345 -> 74565
fedcba -> -74566
calc int -> Tx string
74565 -> 012345
-74566 -> fedcba
How can this be done?