title: How to write text with formatting to a file
body: <p>I want to make a file <code>text.txt</code> with the content:</p>
  
  <pre><code>foo
  bar  baz
  </code></pre>
  
  <p>How can I do this correctly?</p>
  
  <p>I tried to write string <code>x</code>:</p>
  
  <pre><code>x = ""foo\nbar\tbaz"""
  </code></pre>
  
  <p>to <code>text.txt</code>, and I seem to get the content:</p>
  
  <pre><code>foo\nbar\tbaz
  </code></pre>