版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010801696/article/details/83037179
导入模块 xlrd (xlwt向excel中写入信息模块)
import xlrd
wb = xlrd.open_workbook(filename="***.xls")
ws = wb.sheel_by_name("Sheet2")
dataset = []
for r in range(ws.nrows):
col = []
index = 0
for c in range(ws.ncols):
col.append(ws.cell(r,c).value)
index += 1
dataset.append(col)
pprint(dataset)