Answers for "make text go to new line pythn"

4

python writelines newline

lines = ['line1', 'line2']
with open('filename.txt', 'w') as f:
    f.writelines("%s\n" % l for l in lines)
Posted by: Guest on October-19-2020

Code answers related to "make text go to new line pythn"

Python Answers by Framework

Browse Popular Code Answers by Language