我有一个简单的代码:
import xlrd
book = xlrd.open_workbook('import.xls')
for sheet in book.sheets():
for row in range(sheet.nrows):
print sheet.row(row)
但是它正在打印:
sheet1: row1
sheet1: row2
sheet1: row3
sheet2: row1
sheet2: row2
sheet2: row3
and etc
我需要修改这段代码,以便打印出以下内容:
sheet1: row1
sheet2: row1
sheet3: row1
sheet1: row2
sheet2: row2
sheet3: row2
and etc.
任何帮助都将不胜感激。谢谢。