Reading Time: 1 minutes
Copying a file in Python: You can use either copy() function or copyfile() function of builtin module shutil to create a copy of a file.
Copying a file in Python
import shutil |
shutil.copy( 'textOne.txt' , 'textTwo.txt' ) # creates 'textTwo.txt' with contents of 'textOne.txt' |