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