I assume that you want to convert hex to an integer, not a char string.
>>> int("AEAE",16) 44718
or
>>> int("0xAEAE",16) 44718
In response to your comment, one of the ways I can come up with is to use bit shifts:
>>> (ord('\xae') << 8) | (ord('\xae')) 44718
I am not sure if there is a better way.
source share