I'm practicing with files in python, but all of my text comes out on the same line, even if I use '\n' (in which case, only the first string appears. So:
with open('test2.txt', 'w') as f: f.write("I'm trying to write ...") f.write('new content on each line ...') f.write('but it all stays on the first line ...') f.write('Any insight would be appreciated.') ... produces:
I'm trying to write ...new content on each line ...but it all stays on the first line ...Any insight would be appreciated.