Answers for "copy a file and rename it python"

26

python rename file

import os  
os.rename('guru99.txt','career.guru99.txt')
Posted by: Guest on April-01-2020
1

python copy file to new filename

shutil has many methods you can use. One of which is:

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

Code answers related to "copy a file and rename it python"

Python Answers by Framework

Browse Popular Code Answers by Language