本文实例为大家分享了python实现文件批量重命名的具体代码,供大家参考,具体内容如下
代码:
# -*- coding:utf-8 -*-
import os
class ImageRename():
def __init__(self):
self.path = 'D:/xpu/paper/plate_data'
def rename(self):
filelist = os.listdir(self.path)
total_num = len(filelist)
i = 0
for item in filelist:
if item.endswith('