title: Python - Converting Hex to INT/CHAR
body: <p>I am having some difficulty changing a hex to an int/char (char preferably). Via the website;
  <a href="http://home2.paulschou.net/tools/xlate/" rel="noreferrer">http://home2.paulschou.net/tools/xlate/</a> I enter the hex of C0A80026 into the hex box, in the DEC / CHAR box it correctly outputs the IP I expected it to contain.</p>
  
  <p>This data is being pulled from an external database and I am not aware how it is being saved so all I have to work with is the hex string itself.</p>
  
  <p>I have tried using the <code>binascii.unhexlify</code> function to see if I could decode it but I fear that I may not have a great enough understanding of hex to appreciate what I am doing.</p>
  
  <p>Attemping to print just using an int() cast also has not produced the required results. I need some way to convert from that hex string (or one similar) to the original IP.</p>
  
  <p>UPDATE: For anyone who comes across this in the future I modified the below answer slightly to provide an exact printout as an IP by using;</p>
  
  <pre><code>dec_output = str(int(hex_input[0:2], 16)) + "." +  str(int(hex_input[2:4], 16)) + "." + str(int(hex_input[4:6], 16)) + "." + str(int(hex_input[6:8], 16))
  </code></pre>