Skip to content

Instantly share code, notes, and snippets.

@vheidari
Created September 7, 2019 21:54
Show Gist options
  • Save vheidari/5ee5cf99de24f8180de42f58b89aff6c to your computer and use it in GitHub Desktop.
Save vheidari/5ee5cf99de24f8180de42f58b89aff6c to your computer and use it in GitHub Desktop.
rename and numbering files with python.
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