Cody Bable

Generation

generate functionFri, 21 Apr 2023

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

Questions about programming?Chat with your personal AI assistant