This commit is contained in:
injetlee
2016-12-09 14:22:52 +08:00
parent 04ecaaaa5e
commit 18419910fd
4 changed files with 58 additions and 40 deletions

View File

@@ -2,9 +2,10 @@ import os
dir = os.getcwd()
subdir = os.listdir(dir)
for i in subdir:
path = os.path.join(dir,i)
if os.path.isdir(path):
end_dir = os.listdir(path)
for i in range(len(end_dir)):
newname = end_dir[i][0:50]
os.rename(os.path.join(path,end_dir[i]),os.path.join(path,newname))
path = os.path.join(dir, i)
if os.path.isdir(path):
end_dir = os.listdir(path)
for i in range(len(end_dir)):
newname = end_dir[i][0:50]
os.rename(os.path.join(path, end_dir[
i]), os.path.join(path, newname))