xlrd - Python Error:sheet attribute has no column ncolumns -
i learning python on own ,and trying search given text, struck error ,tried google , solve on own of no use. code .
import xlrd book = xlrd.open_workbook("tc0132_shooting_information_display(osd_list)_dmhh.xlsm" , "rb") print book.nsheets print book.sheet_names() first_sheet = book.sheet_by_index(0) # print first_sheet.row_values(10) cell = first_sheet.cell(10 ,10) print cell # print cell.value print first_sheet.row_slice(rowx=9,start_colx=2,end_colx=10) in range(first_sheet.nrows): row = first_sheet.row_values(10) j in range (first_sheet.ncolumns): column == first_sheet.column_values(5) if row[column] == search_value: print i,j print 0 thanks in advance.
there no such attribute ncolumns: have typo:
for j in range (first_sheet.ncols): instead of
for j in range (first_sheet.ncolumns):
Comments
Post a Comment