Python Copy File From one Directory to Another Example
This tutorial will provide example of python copy file from one directory to another. We will use python copy file from one directory to another and rename. you can see python copy file from one location to another. We will use python copy file from a directory to another. So, let's follow few step to create example of python copy file example.
In this example, I will give you a simple example of a copy a file from one directory to another. so let's see a simple example with output.
You can use these examples with python3 (Python 3) version.
import shutil srcFilePath = "files/image1.png" destinationFilePath = "copyFiles/image1.png" shutil.copyfile(srcFilePath, destinationFilePath) print("File Copy Successfully.")
File Copy Successfully.
I hope it can help you...
We are Recommending you
- Python Get First Date of Last Month Example
- Python Get First Date of Next Month Example
- Python Create Zip Archive from Directory Example
- How to Check if Today is Sunday or not in Python?
- How to Check if Today is Wednesday or not in Python?
- How to Check if Today is Tuesday or not in Python?
- Python Check if Date is Weekend or Weekday Example
- Python Subtract Seconds from DateTime Example
- Python POST Request with Parameters Example
- How to Get Current Minute in Python?
- How to Get Current Hour in Python?
- How to Get Current Month in Python?