kaushik kaushik - 4 months ago 40
Python Question

writing string to a file on a new line everytime?

I want to append a newline to my string every time I call

. What's the easiest way to do this in Python?


Use "\n":

file.write("My String\n");

See the Python manual for reference.