import os
def renamefile(path):
num = 1
for file in os.listdir(path):
old = os.path.join(path,file)
new = os.path.join(path,"name"+str(num)+".jpg")
num += 1
os.rename(old,new)
if __name__ == "__main__":
renamefile("C:/Users/admin/Desktop/jpg")
实用python脚本(批量重命名目标文件夹下图片名称)
于 2022-12-29 10:46:29 首次发布