摘要:
get curl -G http://www.xxxx.com/show?userId=111 post curl -d "username=sunnyxd&password=12345" http://www.xxxx.com/show https://stackoverflow.com/ques 阅读全文
摘要:
1、基础的打桩方式 # stub.py import mock import need def myfunc(): pass need.func = mock.MagicMock(side_effect=myfunc) # need.py def func(): pass # main.py imp 阅读全文
摘要:
记录进程报错信息 子进程资源被父进程释放导致子进程退出 阅读全文
摘要:
普通装饰器 from functools import wraps def cover(func): @wraps(func) def wrapper(*args, **kwargs): result = func(*args, **kwargs) return result return wrap 阅读全文
摘要:
LOG_PATH = os.path.abspath(os.path.join(os.getcwd(), "..", "logs")) logging.basicConfig(level=logging.DEBUG, filename=os.path.join(LOG_PATH, 'output.l 阅读全文
摘要:
def multipliers(): return [lambda x: i * x for i in range(4)] print([m(2) for m in multipliers()]) # [6, 6, 6, 6] multipliers内嵌套了一个匿名函数 该匿名函数引用外部非全局变量 阅读全文
摘要:
管理员权限运行cmd route -p add 192.168.0.2 mask 255.255.0.0 192.168.0.1 使用route print查看 route delete 192.168.0.2 使用route print查看 增加的路由应该指向网段,这里应该写route -p ad 阅读全文
摘要:
换源 -i https://pypi.tuna.tsinghua.edu.cn/simple 清华源 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com 阿里源 阅读全文
摘要:
创建环境(路径:venv所处的路径/环境名) python3 -m venv 路径 进入环境 windows 路径/Scripts/activate linux source 路径/bin/activate 阅读全文
摘要:
1. lambda x: x * i 与 lambda x, i=i: x * i 的区别 def multipliers(): # 添加了一个默认参数i=i return [lambda x: i * x for i in range(4)] print([m(2) for m in multip 阅读全文