I handle Excel files using the functions row_values and col_values:
import xlrd
workbook = xlrd.open_workbook( filename )
s
You could be explicit and check that sheet.cell_type(rowno, colno) in (xlrd.XL_CELL_EMPTY, xlrd.XL_CELL_BLANK)
but the docs state the value will be u''
where those are the case anyway.
Instead of using row_values
, you could also use row(n)
which returns a list of Cell
objects which have .value
and .cell_type
attributes.