Cody Bable

Generation

generate functionMon, 24 Apr 2023

read from source file one line at a time and write to target file one line at time.

def copy(source_file, target_file): with open(source_file, 'r') as source: with open(target_file, 'w') as target: for line in source: target.write(line)

Questions about programming?Chat with your personal AI assistant