Last active
September 24, 2022 11:58
-
-
Save GGontijo/76586e17164fdbbc4d615808dbcd148e to your computer and use it in GitHub Desktop.
Mass rename files in a folder
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 | |
for file in os.listdir('.'): | |
if file == 'rename.py': | |
continue | |
name = str(file).split(".")[0] | |
new_name = name + ".jpg" | |
os.rename(file, new_name) | |
print(name + " alterado para " + new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment