#coding=utf-8
import xlrd
class ExcelUntil:
def __init__(self,excel_path=None,index=None):
if excel_path == None:
excel_path = "C:/Users/15927/Documents/SELENIUMPYTHONBASE/config/casedata.xls"
if index == None:
index = 0
self.data = xlrd.open_workbook(excel_path)
self.table = self.data.sheets()[index]
#行数
self.rows = self.table.nrows
def get_data(self):
result = []
for i in range(self.rows):
col = self.table.row_values(i)
print(col)
result.append(col)
return result
if __name__ == "__main__":
ex = ExcelUntil()
print(ex.get_data())