def excel():
fname = "..\\Case\\test.xlsx"
bk = xlrd.open_workbook(fname)
try:
sh = bk.sheet_by_name('Sheet1')
except:
print "%?????Sheet1?" % fname
# ????
nrows = sh.nrows
# ????
ncols = sh.ncols
print '?????%s ?????%s' % (nrows, ncols)
a = []
for i in range(0, nrows):
c = sh.row_values(i)
# if i == 0:
# continue
# else:
# c[0] = int(c[0])
# c[6] = int(c[6])
a.append(c)
return a
# print a
评论列表
文章目录