read from one file and write to another file line by line
# Read from one file and write to another file line by line def read_write_file(infile, outfile): with open(infile) as fr: with open(outfile, 'w') as fw: for line in fr: fw.write(line) read_write_file("infile.txt", "outfile.txt")