title: python compare "\n" escape chars with "\\n"
body: <p>Ok,</p>
  
  <p>I have two strings, <code>"Hello\nWorld!"</code> and <code>Hello\\nWorld!</code>. I have to compare those that way that <code>\n</code> and <code>\\n</code> equals.</p>
  
  <p>Thats not hard. I just <code>string1.replace("\n", "\\n")</code>.</p>
  
  <p>But what if I have to do it right for all escape chars including unicode escapes, so manual replace is not an option.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Exaple case:</p>
  
  <p>I read from file <code>Hello\nWorld!</code> (as seen when file is opened in editor). Python will see <code>Hello\\nWorld!</code></p>
  
  <p>I want to compare the last one with first one the way they are equals.</p>