https://cmdlinetips.com/2012/09/three-ways-to-write-text-to-a-file-in-python/
1 with open("myOutFile.txt", "w") as outF: 2 for line in textList: 3 print(line, file=outF)
all_lines = ['1', '2', '3']
with open("myOutFile.txt", "w") as outF: outF.writelines(all_lines)
with open(out_filename, 'w') as out_file: .. .. .. parsed_line out_file.write(parsed_line)