上一页 1 ··· 9 10 11 12 13 14 下一页
摘要: import logging# logging.debug('today-1')# logging.info('today-2')# logging.warning('today-3')# logging.error('today-4')# logging.critical('today-5')# 阅读全文
posted @ 2022-03-31 15:34 狒狒桑 阅读(12) 评论(0) 推荐(0) 编辑
摘要: import configparsercf = configparser.ConfigParser()cf.read('case.config', encoding='utf-8')# 读取配置文件res1 = cf.get('MODE', 'mode')print(res1)# 读取配置文件res 阅读全文
posted @ 2022-03-30 12:54 狒狒桑 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 代码: import unittestfrom ddt import ddt,data,unpacktest_data = [[1,3],[4,5]]test_data1 = [[1,3], [6,7]]test_data2 = [{"name":"haha", "pwd":"123"}, {"na 阅读全文
posted @ 2022-03-30 01:00 狒狒桑 阅读(117) 评论(0) 推荐(0) 编辑
摘要: from openpyxl import load_workbookclass ReadExcel: def __init__(self, wb_name, sheet_name): self.wb = load_workbook(wb_name) self.sheet = self.wb[shee 阅读全文
posted @ 2022-03-30 00:43 狒狒桑 阅读(41) 评论(0) 推荐(0) 编辑
摘要: from openpyxl import load_workbook#1 打开Excel,返回工作簿wb = load_workbook("test_excel01.xlsx")#2 定位表单, 返回表单对象sheet = wb['test']#3 定位单元格res = sheet.cell(1, 阅读全文
posted @ 2022-03-29 18:32 狒狒桑 阅读(19) 评论(0) 推荐(0) 编辑
摘要: class GetData: Cookie = "xiao"print(GetData.Cookie)setattr(GetData, 'Cookie', "da")print(getattr(GetData, 'Cookie'))print(hasattr(GetData, 'Cookie'))d 阅读全文
posted @ 2022-03-29 17:19 狒狒桑 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1. 基础类 class MathMethod: def __init__(self,a,b): self.a = a self.b = b def add(self): return self.a + self.b def sub(self): return self.a - self.b def 阅读全文
posted @ 2022-03-29 13:43 狒狒桑 阅读(41) 评论(0) 推荐(0) 编辑
摘要: class MathMethod: def __init__(self,a,b): self.a = a self.b = b def add(self): print("我是父类的", self.a + self.b) def sub(self): print( self.a - self.b)c 阅读全文
posted @ 2022-03-28 23:39 狒狒桑 阅读(37) 评论(0) 推荐(0) 编辑
摘要: class BoyFriend: # 类属性 height = 175 weight = 120 money = "500万" def __init__(self, name, age): self.name = name self.age = age # 类函数 def cooking(self, 阅读全文
posted @ 2022-03-28 19:09 狒狒桑 阅读(21) 评论(0) 推荐(0) 编辑
摘要: import ostry: os.rmdir('aaa')except Exception as e: print(e)try: os.rmdir('aaa')except Exception as e: print(e) raisefinally: print('last')try: os.rmd 阅读全文
posted @ 2022-03-28 17:15 狒狒桑 阅读(6) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 下一页