Created
October 24, 2011 16:03
-
-
Save jait/1309385 to your computer and use it in GitHub Desktop.
DCIMify
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/python | |
import os | |
INDEX = 0 | |
def get_filename(): | |
global INDEX | |
name = 'DSC_%04d.JPG' % INDEX | |
INDEX += 1 | |
return name | |
def main(): | |
for filename in os.listdir('.'): | |
if filename.endswith('.jpg'): | |
os.rename(filename, get_filename()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment