thebook = open_workbook(file_to_import)
thesheet = thebook.sheet_by_index(0)
print "show that there is value in the sheet: %s" % thesheet.cell(1,1).value
print "there is nothing in thesheet.col_label_ranges:"
print thesheet.col_label_ranges
for crange in thesheet.col_label_ranges:
rlo, rhi, clo, chi = crange
for rx in xrange(rlo, rhi):
for cx in xrange(clo, chi):
print "Column label at (rowx=%d, colx=%d) is %r" \
(rx, cx, thesheet.cell_value(rx, cx))
特定のセルの行と列のラベルを取得しようとしていますが、上記で使用したcol_label_rangesをループするコードが見つかりました。ただし、このコードを実行すると、次の結果が得られます。
show that there is value in the sheet: Katherine
there is nothing in thesheet.col_label_ranges:
[]
何が問題になっているのか、セルの行と列のラベルを読み取るにはどうすればよいですか?