import os
rootimgs = 'D:\dataset\cityscapes\cityscape_voc_foggy\JPEGImages\\'
rootxmls = 'D:\dataset\cityscapes\cityscape_voc_foggy\Annotations\\'
allusedxmls = []
file_imgs = os.listdir(rootimgs)
file_xmls = os.listdir(rootxmls)
for file_xml in file_xmls:
file_name = file_xml[:-4] + '_foggy_beta_0.005.xml'
oldname = rootxmls + file_xml
newname = rootxmls + file_name
os.rename(oldname, newname)
Python文件批量改名
于 2022-04-27 10:30:43 首次发布