Created
November 7, 2016 05:33
-
-
Save andresdhn/4c4c9a1587e2f57c3f0f6df3dcd79e7c to your computer and use it in GitHub Desktop.
Rename files sequentially using 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 glob, re, os | |
for filename in glob.glob('/Users/your-name/Documents/presentation/*.jpg'): | |
new_name = filename.replace("slide", "slide-") | |
print filename | |
print new_name | |
os.rename(filename, new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment