![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
juewuer
这个作者很懒,什么都没留下…
展开
-
腾讯AI开放平台接口鉴权的Python版本
想做一个飞书想做一个聊天机器人,查到腾讯有智能闲聊,使用了使用腾讯闲聊,做接口鉴权时,例子是php的,人生苦短,我用python,做完了,贴出来,做个参考 import hashlib def getReqSign(params:dict, appkey) -> str: sign = '' for key,value in sorted(params.items()): if not value: continue sign =原创 2020-11-19 14:21:28 · 277 阅读 · 0 评论 -
被pytest_namespace折腾的要死了
用pytest一直报错, 返回的调用栈如下 INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 206, in wrap_session INTERNALERROR> session.exitstatus = doit(config, session) or 0 IN原创 2020-09-25 15:30:43 · 883 阅读 · 1 评论 -
Python类和类变量的继承
文章目录基类代码执行结果 基类 代码 class Father: name = 'father' def __init__(self): print("In Father __init__()",self.__class__.name) return def __new__(cls) -> Any: print("In Father __new__()", cls.nam...原创 2019-12-12 17:04:48 · 718 阅读 · 0 评论 -
Python的多重继承问题
因为要写个测试用例,测试4层LB,7层LB,这种测试只有一个参数不一样,实在不愿意把代码复制一份,想到了先写一个测试类,在分别继承这个测试类,写俩L4,L7子类 代码如下 class LbTest(): ##初始化工作 def setUp(self): print "in class %s, func %s" % (self.__class__.__name__, sys....原创 2018-06-07 13:41:26 · 521 阅读 · 0 评论 -
python ipaddress模块简介
文章目录原著概述创建Address/Network/Interface1. IP地址2. 网段地址3. 主机接口(CIDR)Address/Network/Interface成员函数获取ip地址的版本,ipv4或者ipv6:从ip地址获取网络地址:获取网段中地址数目:ip_network.hosts迭代获取可用的主机地址(没有广播和0地址)`netmask/hostmask`来获取网络/主机掩码:...原创 2019-03-01 16:48:16 · 3285 阅读 · 0 评论 -
python的exitit模块
atexit 模块可以使用atexit.register(func, *args, **kwargs)注册函数,在程序退出之前执行,也可以通过atexit.unregister(func)解注册,函数执行顺序与注册顺序相反。比如依次注册函数 A, B, and C,在程序退出时函数执行顺序为C, B, A. 另外,也可以通过装饰器模式注册退出函数atexit.register 以下为具体示例: i...原创 2019-03-04 10:25:01 · 272 阅读 · 0 评论