How to Copy File From one Directory to Another in Python?
This tutorial will provide example of python copy file from one directory to another and rename. if you want to see example of python copy file from one location to another then you are a right place. let’s discuss about python copy file from one directory to another. it's simple example of python copy file from a directory to another.
I'll give you a straightforward illustration of how to copy a file from one directory to another in this example. let's examine a straightforward example with output.
You can use these examples with python3 (Python 3) version.
So let's see bellow example:
import shutil srcFilePath = "files/demo.png" destinationFilePath = "copyFiles/demo.png" shutil.copyfile(srcFilePath, destinationFilePath) print("File Copy Successfully.")Output
File Copy Successfully.
It will help you....
Happy Pythonic Coding!