Created
October 21, 2014 09:49
-
-
Save ColtonPhillips/d81b06af1402e4f18b14 to your computer and use it in GitHub Desktop.
I just wanted a script to rename my JPEG files that my camera created, so it would look better when I upload to flickr.
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
#!/usr/bin/env python | |
from os import rename, listdir | |
badprefix = "IMG" | |
fnames = listdir('.') | |
print(fnames) | |
for fname in fnames: | |
if fname.startswith(badprefix): | |
rename(fname, fname.replace(badprefix, 'long_exposure', 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment