批量更改文件
# 代码示例
import os
godir = os.listdir('F:\cka认证\oldboy_go')
for i in godir :
print(i)
if i.count('樱花论坛') :
filename = i.split('【樱花论坛 www.sakuraaaa.com】',1)[1]
print(filename)
oldname = 'F:/cka认证/oldboy_go/'+i
newname = 'F:/cka认证/oldboy_go/'+filename
os.rename(oldname,newname )
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
上次更新: 2024/12/04, 17:15:49