To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Define the function as copy with arguements as existing file name and new file name.
Open the existing file to read.
Open the new file to write.
Copy the contents from existing file to new file.
Get the inputs from the user for existing file and new file. Call the function.
End the program.
Write a python program for copying the contents from one file to another file.
Develop bY: M THEJESHWARAN
Register no: 212223240168
with open("text.txt",'r') as fp:
msg1=fp.read()
with open("copy.txt",'w') as fp1:
fp1.write(msg1)
Thus the program is written to copy the contents from one file to another file.