title: Python: binary/hex string conversion?
body: <p>I have a string that has both binary and string characters and I would like to convert it to binary first, then to hex.</p>
  
  <p>The string is as below:</p>
  
  <pre><code>&lt;81&gt;^Q&lt;81&gt;"^Q^@^[)^G ^Q^A^S^A^V^@&lt;83&gt;^Cd&lt;80&gt;&lt;99&gt;}^@N^@^@^A^@^@^@^@^@^@^@j
  </code></pre>
  
  <p>How do I go about converting this string in Python so that the output in hex format is similar to this below?</p>
  
  <pre><code>24208040901811001B12050809081223431235113245422F0A23000000000000000000001F
  </code></pre>