Cody Bable

Generation

generate functionFri, 21 Apr 2023

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()

Questions about programming?Chat with your personal AI assistant