To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Get the file name and location from the user.
Give a new file name to create a copy of a file content.
Read the file and close the file.
Now write the content in the new file.
When done print"File copied successfully".
End of the program
#Developed by: ARAVINDAN D
#Register Number: 212223240012
with open("text1.txt", 'r') as fp:
msg=fp.read()
with open("copy.txt", 'w') as fp1:
fp1.write(msg)
Thus the program is written to copy the contents from one file to another file.