读取图片后重新命名

import os
from PIL import Image

path = 'E:/3Dmoxing/11'
path1 = os.listdir(path)

for i in path1:
    im = Image.open(path + '/' + i)
    b = i.split('_')[0]
    c = i.split('_', 1)[1]
    path_xiugai = './33/' + b + '_20221113_' + c
    im.save(path_xiugai)

你可能感兴趣的:(pycharm,深度学习)