Created
July 31, 2014 09:17
-
-
Save sota1235/a33bef0b97f667463ac8 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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| 注意:sort済みのフォルダに使うとごっちゃになります | |
| """ | |
| import os | |
| import sys | |
| path = sys.argv[1] | |
| file_list = os.listdir("./" + path) | |
| count = 1 | |
| for f in file_list: | |
| if f[0:1] == ".": | |
| print f | |
| continue | |
| os.rename(path + "/" + f, path + "/" + str(count) + "." + f.split(".")[1]) | |
| count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment