title: Convert ASCII characters to hex escaped strings
body: <p>I was reading in a file from Python. I opened this file and used 'rb' to read the bytes. When I read them off, say:</p>
  
  <pre><code>f.read(1)
  </code></pre>
  
  <p>it would output something like this</p>
  
  <pre><code>b'\x50'
  </code></pre>
  
  <p>So my question is, when I tried a longer string like this</p>
  
  <pre><code>f.read(24)
  </code></pre>
  
  <p>I got this:</p>
  
  <pre><code>b'R\x00S\x00S\x00Q\x00S\x00O\x00N\x00P\x00S\x00M\x00R\x00P\x00
  </code></pre>
  
  <p>You notice that there are <a href="http://en.wikipedia.org/wiki/ASCII" rel="nofollow">ASCII</a> characters mixed into the hex. I would want the R to be displayed as \x52.</p>
  
  <p>How do I do that?</p>