fw.write('\n'.join(line_list) + '\n')
lines = ['line1', 'line2'] with open('filename.txt', 'w') as f: f.writelines("%s\n" % l for l in lines)