Cody Bable

Generation

generate functionFri, 21 Apr 2023

read from one file and write to another file line by line

def copy(input_file, output_file): in_file = open(input_file, 'r') out_file = open(output_file, 'w') for line in in_file: out_file.write(line) in_file.close() out_file.close() copy('input.txt', 'output.txt')

Questions about programming?Chat with your personal AI assistant