How do i write a new line or \n into a file
<p>I have a simple code where i wanted to write 2 files into 1. I wanted to write a new line or '\n' after the first file is written. I tried using files.write but unable to do it. Can someone help me in this?</p>

<p>This is my code:</p>

<pre><code>files = run('ls -ltr /opt/nds')
files1 = run('ls -ltr /opt/web')
with open(section + "_tmp"+".txt", "w") as fo:
    fo.write(files)
with open(section + "_tmp"+".txt", "a") as fi:
    fi.write(files1)
</code></pre>

<p>Here, after the files is written, i wanted to add a new line before files1 is appended to the same file.</p>