I am writing a python program to copy a file line by line into a new file. The code I have is below in which I am using a loop to copy the file line by line.
Howeve
Files can be iterated directly, without the need for an explicit call to readline:
readline
f = open("...", "r") copy = open("...", "w") for line in f: copy.write(line) f.close() copy.close()