我想导入一个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)