Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python writelines newline

lines = ['line1', 'line2']
with open('filename.txt', 'w') as f:
    f.writelines("%s
" % l for l in lines)
Source by satishpython.blogspot.com #
 
PREVIOUS NEXT
Tagged: #python #writelines #newline
ADD COMMENT
Topic
Name
4+5 =