Skip to content

Instantly share code, notes, and snippets.

@ColtonPhillips
Created October 21, 2014 09:49
Show Gist options
  • Save ColtonPhillips/d81b06af1402e4f18b14 to your computer and use it in GitHub Desktop.
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.
#!/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