标签:range font 图片 表格 style actual inf expec return
from openpyxl import load_workbook
class Case:
def __init__(self):
self.case_id = None
self.title = None
self.method = None
self.url = None
self.data = None
self.expected = None
self.actually = None
self.result = None
class ReadData:
def __init__(self, file_name):
self.file_name = file_name
self.wb = load_workbook(self.file_name)
def read_data(self, sheet_name):
self.sheet_name = sheet_name
sheet =self.wb[self.sheet_name]
case_data = []
for row in range(2, int(sheet.max_row)+1):
case = Case()
case.case_id = sheet.cell(row, 1).value
case.title = sheet.cell(row, 2).value
case.method = sheet.cell(row, 3).value
case.url = sheet.cell(row, 4).value
case.data = sheet.cell(row, 5).value
case.expected = sheet.cell(row, 6).value
case_data.append(case)
return case_data
if __name__==‘__main__‘:
标签:range font 图片 表格 style actual inf expec return
原文地址:https://www.cnblogs.com/sophia-985935365/p/12629524.html