title: Unpack string with hexadecimals
body: <p>I have a string that contains a float value in hexadecimal characters like this:</p>
  
  <pre><code>"\\64\\2e\\9b\\38"
  </code></pre>
  
  <p>I want to extract the float, but in order to do that I have to make Python see the string as 4 hex characters, instead of 16 regular characters. First I tried replacing the forward slashes, but I got an error:</p>
  
  <pre><code>&gt;&gt;&gt;&gt; hexstring.replace("\\", "\x")
  ValueError: invalid \x escape
  </code></pre>
  
  <p>I've discovered </p>
  
  <pre><code>struct.unpack("f", "\x64\x2e\x9b\x38") 
  </code></pre>
  
  <p>does exactly what I want, but how do I convert the string?</p>