Created
September 7, 2019 21:54
-
-
Save vheidari/5ee5cf99de24f8180de42f58b89aff6c to your computer and use it in GitHub Desktop.
rename and numbering files with python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
fileNames = ["one", "two", "three"] | |
i = 1 | |
for fileName in fileNames: | |
srcName = "./" + fileName | |
destName = "./dest/" + str(i) + "." + fileName | |
i = i + 1 | |
shutil.copy(srcName, destName) | |
print("successfully, renamed file names. and copied in to : " + destName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment