writelines go to next line in python code example Example: write lines python with line breaks fw.write('\n'.join(line_list) + '\n')