I have been trying to make a python file that will copy contents from one folder to another. I would like it to work on any Windows system that I run it on. It must copy ALL things .
i need solution to this problem.
I have been trying to make a python file that will copy contents from one folder to another. I would like it to work on any Windows system that I run it on. It must copy ALL things .
i need solution to this problem.
You can use the copytree function of the shutil library:
import shutil
source_folder = "C:\\Users\\user1\\source_folder"
destination_folder = "C:\\Users\\user1\\destination_folder"
# Copy the contents of the source folder to the destination folder
shutil.copytree(source_folder, destination_folder)