Created
August 16, 2010 09:43
-
-
Save akiraak/526706 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 glob | |
import os | |
no = 1 # 連番の最初の数字 | |
files = glob.glob('*.jpg') | |
for file in files: | |
file = './' + file | |
new_file = '{0:04}'.format(no) + '.jpg' | |
print './' + file + ' -> ' + new_file | |
os.rename(file, new_file) | |
no = no + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment