import oscompanylist = ["成都","绵阳","南京","苏州","三亚","海口","佛山","东莞","广州","深圳","珠海","中山","昆明","重庆","长沙","衡阳","武汉","襄阳","西安","延安","厦门","福州","宁波","温州","石家庄","唐山","南宁","郑州","济南","青岛","长春","哈尔滨","沈阳","大连","太原","合肥","芜湖","南昌","西宁","兰州","银川","呼和浩特","乌鲁木齐","贵州","拉萨"]def RENAME():filepath = "./file/"filelist = os.listdir(filepath)for index,file in enumerate(filelist):olddir = os.path.join(filepath,file)filename = os.path.splitext(file)[0]filetype = os.path.splitext (file)[1]newdir = os.path.join(filepath,companylist[index]+"分公司"+filetype)os.rename(olddir,newdir)print(index+1,newdir)RENAME()