我想导入一个 EXCEL 文件, 但代码有些错误。 救命!
import xlrd
fname = "D:/pdf-ex/exc.xls"
bk = xlrd.open_openwork("fname","rb")
shxrange = range(bk.nsheets)
sh = bk.sheet_by_name("Sheet1")
nrows = sh.nrows
ncols = sh.ncols
print "nrows %d, ncols %d" % (nrows,ncols)
cell_value = sh.cell_value(1,1)
print cell_value
row_list = []
for i in range(1,nrows):
row_data = sh.row_values(i)
row_list.append(row_data)