摘要: 参考这篇博客:https://www.cnblogs.com/zisefeizhu/p/14958899.html 阅读全文
posted @ 2021-10-25 17:47 maxwell11 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 1.pytest官方文档: 官网:https://docs.pytest.org/en/latest/ PYPI地址:https://pypi.org/project/pytest/ 英文文档地址:https://docs.pytest.org/en/stable/ 中文文档地址:https://w 阅读全文
posted @ 2021-01-29 01:55 maxwell11 阅读(511) 评论(1) 推荐(0) 编辑
摘要: 1. 公司最近项目需要压测一个websocket接口,接口走nginx网关,使用jmeter的websocket采样器调用发生错误: 2. 调用后,发现响应头和响应正文都为空,取样器结果,响应状态码为308,响应信息:Response message:Got unexpected status 30 阅读全文
posted @ 2021-01-26 11:28 maxwell11 阅读(2234) 评论(0) 推荐(1) 编辑
摘要: 1.使用深拷贝或浅拷贝时,需要先引入copy import copy <1>.不使用copy的方式 # a = [1, 2, 3] # b=a相当于把a赋值给b,a和b指向的是同一个引用,当a的值发生了改变,b也会随之改变 # b = a # a[0] = 5 # print(a) # [5, 2, 阅读全文
posted @ 2021-01-26 00:53 maxwell11 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1.判断 if 条件表达式: <1>.条件表达式为布尔值,如 == ,is ,>,<,=, in 省略的写法,变量存在,执行if 后面的代码: if a: xxxxxxxx 当a 为true时执行if 后面的代码,为false不会执行 # a=0, a=0.0, a=[], a=(), a={}, 阅读全文
posted @ 2021-01-25 22:06 maxwell11 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 1.元组: <1>.定义:(),不能改值的数组 a = 1,2,3,4,5 print(type(a)) #tuple 单个元组的定义(a,) <2>. 字符串可以直接转成元组: c = '1234' # print(tuple(c)) # ('1', '2', '3', '4') <3>. 索引, 阅读全文
posted @ 2021-01-24 20:23 maxwell11 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1.字典,python中的一种数据结构,以key ,value格式存储,是可变数据类型 2.字典的定义:key不能重复,字典的key 可以是字符串或整数 value可以是任意数据类型,可以重复,可以是字符串,列表,字典,元组,布尔值等 3.二维元组或列表可以直接转成字典 a = (('mac', 1 阅读全文
posted @ 2021-01-23 22:58 maxwell11 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 1.闭包: def func(): print('this is func') def func_inner(): print('this is inner') # func函数执行之前返回内部函数引用 return func_inner a = func()# 调用内部函数 a()#输出: thi 阅读全文
posted @ 2021-01-20 02:08 maxwell11 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 1.zip函数,系统函数,可以将多个列表合并,生成一个新的列表,返回结果是生成器 # a = [49, 80, 78, 60]# b = ['张三', '李四', '小明', '小红']# d = ['13121111111', '13222222222', '1333333333s3', '134 阅读全文
posted @ 2021-01-20 01:56 maxwell11 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1. 类和对象 类--对一类事物的抽象 没有实际意义 对象 真实客观存在的 类的实例化 类的具体化 类的定义 Class 类名(大驼峰命名,首字母大写),默认继承object,可以多继承2.编写一个类 两类内容:属性 变量 行为--函数(方法) 属性 自我独有--成员属性(属于对象) 大家共享的 类 阅读全文
posted @ 2021-01-17 15:55 maxwell11 阅读(119) 评论(0) 推荐(0) 编辑