title: Convert a string of escaped hex to a hex number in Python
body: <p>How do I convert a string of escaped hex characters to a single hex number?</p>
  
  <p>Reading from a socket I get a string of \xFF\xFF\xFF.., etc. I want to convert this to a hex number, 0xFFFFFF, keeping any insignificant 0s, so \x00\xFF should be 0x00FF. I have tried various functions from binascii, but I have not had any luck.</p>