It is very easy to copy file in python. In this tutorial, we will use an example to show you how to do.
Here is an example code:
import shutil import os src= r'C:\Newfile\file2.txt' dst = r'D:\file2.txt' shutil.copyfile(src, dst)
In this tutorial, we will use python shutil library to copy files.