How to convert hex string to hex number?
Sample Code :
print "%x"%int("2a",16)
Using the string formatters (new first, then old):
>>> '{:x}'.format( 12345678 )
'bc614e'
>>> '%x' % ( 12345678 )
'bc614e'
>>> print int('0x10', 16)
16
Are you asking how to convert the string format hexadecimal value '16' into an integer (that is, end up with an integer with decimal value 22)? It's not clear from your question. If so, you probably want int('16', 16)