title: Python: How to convert a string containing hex bytes to a hex string
body: <p>I'm thinking binascii is the module I'm looking for, but I can't quite seem to get the exact results for which I am looking.</p>
  
  <p>Here's what I want to do.  I want to convert:</p>
  
  <pre><code>&gt;&gt;&gt; s = '356a192b7913b04c54574d18c28d46e6395428ab'
  &gt;&gt;&gt; print len(s)
  40
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&gt;&gt;&gt; hs = '\x35\x6a\x19\x2b\x79\x13\xb0\x4c\x54\x57\x4d\x18\xc2\x8d\x46\xe6\x39\x54\x28\xab'
  &gt;&gt;&gt; print len(hs)
  20
  </code></pre>
  
  <p>Any Pythonistas know of a cool (or, frankly, functional) way to do this?</p>