title: Python how to output characters as raw text
body: <p>Whenever I try to get the unicode number from a string that has "\xff" in it I get an error.</p>
  
  <pre><code>test = ord(str(tmp1))
  TypeError: ord() expected a character, but string of length 4 found
  </code></pre>
  
  <p>How can I avoid this?</p>
  
  <p>Edit - The output of <code>print(repr(tmp1))</code> is <code>'\\xff'</code></p>
  
  <p>Edit - Is there anyway you can find the byte version of a character? eg 255 -> \xff instead of getting ÿ</p>