我有一个简单的代码:
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.
任何帮助将不胜感激。谢谢