import openpyxl, os base = r"e:\MCStudioDownload\work\3027246179@qq.com\Cpp\AddOn\309c2d420bc84ee986db9cdd070ff02a" wb = openpyxl.load_workbook(os.path.join(base, "幸存者军火库食物表.xlsx")) ws = wb["全食物数据表"] ids = ["taco","taco_rotten","coxinha","rotten_coxinha","coxinha_dough","raw_coxinha", "pastel_dough","raw_cheese_pastel","raw_meat_pastel","raw_wind_pastel", "meat_pastel","wind_pastel","pacoquita"] for r in range(3, ws.max_row + 1): if ws.cell(row=r, column=2).value in ids: print(ws.cell(row=r, column=2).value, "->", ws.cell(row=r, column=3).value)