Answers for "python copy directory to another location"

8

copy whole directory python

import shutil

shutil.copytree(source, destination)
Posted by: Guest on March-06-2020
6

python copy file to another directory

import shutil
shutil.copy2('/src/dir/file.ext', '/dst/dir/newname.ext') # complete target filename given
shutil.copy2('/src/file.ext', '/dst/dir') # target filename is /dst/dir/file.ext
Posted by: Guest on February-22-2021
0

copy directory from one location to another python

# Source path 
src = 'C:/Users / Rajnish / Desktop / GeeksforGeeks / source'
   
# Destination path 
dest = 'C:/Users / Rajnish / Desktop / GeeksforGeeks / destination'
   
# Copy the content of 
# source to destination 
destination = shutil.copytree(src, dest)
Posted by: Guest on April-14-2021

Code answers related to "python copy directory to another location"

Python Answers by Framework

Browse Popular Code Answers by Language