title: How can I parse a bytestring in Python 3?
body: <p>Basically, I have two bytestrings in a single line like this:</p>
  <pre><code>b'\xe0\xa6\xb8\xe0\xa6\x96 - \xe0\xa6\xb6\xe0\xa6\x96\n'
  </code></pre>
  <p>This is a <a href="https://en.wikipedia.org/wiki/Unicode" rel="nofollow noreferrer">Unicode</a> string that I'm importing from an online file using <code>urllib</code>, and I want to compare the individual bytestrings so that I can replace the wrong ones. However, I can't find out any way to parse the string so that I get <code>\xe0\xa6\xb8\xe0\xa6\x96</code> and <code>\xe0\xa6\xb6\xe0\xa6\x96</code> in two different variables.</p>
  <p>I tried converting it into a raw string like <code>str(b'\xe0\xa6\xb8\xe0\xa6\x96')</code> and the indexing actually works, but in that case I can't revert back to the original bytestring in the first place.</p>
  <p>Is it possible?</p>