I searched some questions and answers about this topic: How to convert the hex string to hex numberic in python,for example:
hex_str = a1b2c3d4
result = int(hex_str,16)
hex_num = hex(result)
type(hex_num) #i got the 'str' type
As you see above,i think hex_num shoudle be 0xa1b2c3d4, and i can compare it with 0xa1b2c3d4 and will print matched string
if hex_num == 0xa1b2c3d4:
    print 'matched'
but, the code can not run to line 'print' sentence.


intobjectsclass Hex(int)which implements whatever methods you desire (e.g.__str__).2712847316 == 0xa1b2c3d4evaluates toTrue. At the end of the day, all numbers are really binary internally. Python emphasizes this concept by treating representations and actual numbers well defined. int objects display all values in base 10, unless you use some other representation (such ashex), but all representations convert to the same int object for arithmetic.