Skip to content

Instantly share code, notes, and snippets.

@dansku
Created May 31, 2013 01:26
Show Gist options
  • Save dansku/5682443 to your computer and use it in GitHub Desktop.
Save dansku/5682443 to your computer and use it in GitHub Desktop.
Renaming JPEGmini files with Python
import os
for filename in os.listdir("."):
if filename.endswith('_mini.jpg'):
mini = filename.find('_mini.jpg')
name = filename[:mini] + '.jpg'
os.rename(filename, name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment