python实现读取excel

实现代码如下:

#读取excel,将每行数据放入一个列表,将所有列表放入一个列表形成二维列表,返回该二维列表
import xlrd
class ReadExcel:
    def read_excel(self,path):
        book = xlrd.open_workbook(path)
        sheet = book.sheets()[0]
        li = []
        for i in range(1, sheet.nrows):
            li.append(sheet.row_values(i))
        return li
原文地址:https://www.cnblogs.com/badbadboyyx/p/11953210.html