import os
def Rename(path):
file_name = os.listdir(path)
# print(file_name)
p_0=len(file_name)
p=0
for name in file_name:
old_path = path+'\\'+name
new_path = path+'\\'+'2月'+name
os.renames(old_path,new_path)
path = 'D:\工作\业务策略板块\项目\线上学时分析'
Rename(path)
【高效办公】OS模块对文件夹所有文件重命名
最新推荐文章于 2023-12-23 01:05:13 发布