Copy the content of the file into another in Python

Source code :

with open('file2.txt', 'w+') as output, open('file.txt', 'r') as input:
    while True:
        data = input.read(100000)
        if data == '':  
            break
        output.write(data)
        print("copyed")

Output :

copied
 

Output :


                

Comments :