2021
01-13
01-13
python excel和yaml文件的读取封装
excelimportosimportxlrdPATH=lambdap:os.path.abspath(os.path.join(os.path.dirname(__file__),p))classExcelData:def__init__(self,file,sheet="sheet1",title=True):#判断文件存在不存在ifos.path.isfile(PATH(file)):self.file=PATH(file)self.sheet=sheetself.title=titleself.data=list()self.workbook=xlrd.open_workbook(self.file)else:ra...
继续阅读 >