Writing a string(with new lines) to a file in python
<p>I have to write strings with newlines and a specific structure to files in Python. When I do </p>

<pre><code> stringtowrite = "abcd ||
                   efgh||
                   iklk"

f = open(save_dir + "/" +count+"_report.txt", "w")
f.write(stringtowrite)
f.close()
</code></pre>

<p>I'm getting this error:
SyntaxError: EOL while scanning string literal</p>

<p>How can I write the string as it is to a file without deleting the new lines?</p>

<p>Thanks for your help.</p>
