Created
January 29, 2018 06:22
-
-
Save kinsluck/5067f83acd1ffa090cbf3b986dc4993e to your computer and use it in GitHub Desktop.
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
import os | |
dd = ['十', '一', '二', '三', '四', '五', '六', '七', '八', '九'] | |
for item in os.listdir('.'): | |
fname = str(item) | |
# a=len(fname) | |
new = '' | |
for i in range(len(fname)): | |
if fname[i] in dd: | |
new += str(dd.index(fname[i])) | |
else: | |
new += fname[i] | |
os.rename(item, new) | |
print(new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment