|
That is a hexadecimal number represented in ASCII (or another character set). For portability, you'd want to use a built-in converter that would accomodate the locale and type of character representation (unicode or whatever). I can't tell you what that would be, in Python (novice here), but someone probably can. If you know the encoding scheme, you can roll your own. The problem is if your app is moved to a system with a different local or character-encoding method.
To answer your question in one form: IF that were ASCII, you could toss the characters "\x" and leave yourself with the 1 and the 0. Subtract the offset (30 hex, decimal 48) that makes it a character, leaving yourself with two values, 1 hex and 0 hex. Multiply the first one by 16 (16^1 -- it's the 'tens' digit for base 16), multiply the second by 1 (16^0, it's the 'units' digit), add them, and Bob's your aunt (no, that's Gertie, isn't it?). I'm not recommending you do it that way, portability suffers. I tell you only so you can see the process of encoding and decoding and conversion from one base to another.
|