Last active
March 22, 2021 00:58
-
-
Save Lucs1590/22f005f182673a62c38447b62d4325eb to your computer and use it in GitHub Desktop.
This is a code to rename a lot of things using Python 3
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
# Pythono3 code to rename multiple | |
import os | |
import glob | |
def main(): | |
caminho = "path/to/archives/" | |
for i, arquivo in enumerate(glob.glob(os.path.join(caminho, "*.jpg"))): | |
new_file = caminho + "name" + str(i) + ".jpg" | |
os.rename(arquivo, new_file) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment