Answers for "python copy files to another location"

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 a file from one directroy to other using python

# to copy a file from one place to other
import shutil

shutil.copy2('source/my_file.jpg', 'copy_here/my_file_copy.jpg')
Posted by: Guest on December-03-2021

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

Python Answers by Framework

Browse Popular Code Answers by Language