import openpyxl as xl
wb=xl.load_workbook("C:\\praveen\\python\\Excel\\Book1.xlsx")
title_column_name="Name"
ws=wb.active
searchstring="joe"
for row in list(ws.rows)[1:]:
if row[1].value.find(searchstring)!= -1:
print("found a matching row!slno={0}, name={1}, subject={2}, marks={3}".format(row[0].value, row[1].value, row[2].value. row[3].value))
错误输出: AttributeError:“ str”对象没有属性“ row”