Python copy a file

Your video will begin in 10
76 Views
Published
Python copy a file tutorial example explained

#python #copy #copying #file

# copyfile() = copies contents of a file
# copy() = copyfile() + permission mode + destination can be a directory
# copy2() = copy() + copies metadata (file’s creation and modification times)

import shutil

shutil.copyfile('test.txt','copy.txt') #src,dst

-----------------------------------------------------------------------------------------------------
Bro Code merch store: https://teespring.com/stores/bro-code-5
-----------------------------------------------------------------------------------------------------
Category
Bro Code
Tags
python copying a file, python copy a file, python copy file
Be the first to comment