def rename_temp(): img_PATH = r"./test" flag = "(1)" csvfile = open(r'./patientID.csv', 'w', newline='') for path, dirs, files in os.walk(img_PATH): for filename in files: # 遍历所有文件 num = ((filename.split("_")[1]).split(")")[0]).split("(")[-1] file_pat