read from one file and write to another file line by line until end of file
def read_write(read_file, write_file): with open(read_file, 'r') as rf: with open(write_file, 'w') as wf: line = rf.readline() while line: print(line, end='') wf.write(line) line = rf.readline()