Easier way to add "\n" to all output lines in Python?
<p>The following script works for me, but I wonder if it could be done in an easier way.
I am using Python 2.7.3.</p>

<pre><code>f = open('file.txt')
out = open('script.sql', "w")
for line in f:
        out.write('%s%s' % (line[:-1], '\n'))
f.close()
out.close()
</code></pre>

<p>Thanks,</p>
