python在列中search一个string,并从同一行返回另一个列值

我目前正在尝试编写一个脚本,用于评估电子表格以search列A中的string,然后一旦find该string,就在同一行中输出列I的值。 到目前为止,我有下面的代码,但它没有让我很远。

任何帮助将不胜感激。

import openpyxl wb = openpyxl.load_workbook("2016_SF.xlsx", data_only=True) ws = wb["161226-161228"] last_r=70 search_str = raw_input("What plant are you looking for? > ") last_r = cell.row def FindXlCell(search_str,last_r): for row in ws.iter_rows(row_offset=last_r): for cell in row: if (search_str == cell.value): print(search_str, last_r, cell.row,)