Answers for "copy and paste a file python"

2

python copy paste file

#shutil module has many methods you can use
from shutil import copyfile
copyfile(source, destination)
# Copy the contents of the file named src to a file named dst. Both src and dst need to be the entire filename of the files, including path.
# The destination location must be writable; otherwise, an IOError exception will be raised.
# If dst already exists, it will be replaced.
# Special files such as character or block devices and pipes cannot be copied with this function.
# With copy, src and dst are path names given as strs.
Posted by: Guest on May-03-2021
0

copyfile pyhon

from shutil import copyfile
copyfile(src, dst)
Posted by: Guest on October-03-2020

Code answers related to "copy and paste a file python"

Python Answers by Framework

Browse Popular Code Answers by Language