for img in os.listdir(polyu_path):
before_per = img.split('p')[1].split('_c')[0]
new_per = img.split('p')[0] + 'p'+ str(int(img.split('p')[1].split('_c')[0]) + (87)) + '_' + img.split('_')[2]
os.rename(polyu_path + img, polyu_path + new_per )
结果:
原本: