title: Python: How to convert hex to dotted decimal
body: <p>Given netmask in hex format e.g.0xffffff00 (or sometimes without the '0x' in front), I would like to convert it into dotted decimal format e.g.255.255.255.0. </p>
  
  <p>What I have tried so far:</p>
  
  <pre><code>print binascii.a2b_hex("0xffffff00")
  
  print bytearray.fromhex("ffffff00").decode()
  
  mystring = "0xffffff00"
  print mystring.decode('hex')
  </code></pre>
  
  <p>But the error returned states "non-hexadecimal digit found". May I know what am I doing wrong that I'm not aware of?</p>