title: How to write a string with escaped \n to a file
body: <p>Say I have a json file like</p>
  <pre><code>{&quot;text&quot;:&quot;Here is a string\nhere is another string&quot;,&quot;timestamp&quot;:&quot;2021-05-24&quot;}
  </code></pre>
  <p>I am trying to load it to a file and write the text field down, so the output file will be exactly</p>
  <pre><code>Here is a string\nhere is another string
  </code></pre>
  <p>However, if I read it as a json and do something like <code>out.write(j['text'])</code>, I will get</p>
  <pre><code>Here is a string
  here is another string
  </code></pre>
  <p>in the file, which translates <code>\n</code> into a new line. Is there a way I could output the string in the desired way?</p>