首页
学习
活动
专区
工具
TVP
发布

sktj

专栏作者
1542
文章
1894847
阅读量
34
订阅数
python 企业微信发送脚本
GIT方式:git clone https://github.com/huangantai/QywxPython.git 1、调用方式: python qywx.py -t text -m 测试消息发送 python qywx.py -t image -m /root/test.png python qywx.py -t voice -m /root/test.amr python qywx.py -t video -m /root/test.mp4 python qywx.py -t file -m /root/test.zip 可以直接脚本调用,也可以在其他python中导入引用。 2、qywx.py import urllib.request import json import requests import logging import os import sys import getopt
用户5760343
2022-05-14
2.1K0
python 单元测试框架unittest
test case是单元测试中的最小个体。它检查特定输入的响应信息。unittest提供了一个基础类:TestCase,用来创建test case。 test suite是test case的合集,通常用test suite将test case汇总然后一起执行。 test runner是一个执行器,它可以执行case并提供结果给用户。它可以提供图形界面、文本界面或者返回一个值表示测试结果。 1、unittest官方文档:中文https://blog.csdn.net/ljl6158999/article/details/80994979 2、用法:
用户5760343
2022-05-14
3420
python 并行编程 多线程 锁 信号 条件 事件
class threading.Thread(group=None, target=None, name=None, args=(), kwargs={}) import threading
用户5760343
2022-05-13
3160
python 线程 锁 with
import threading import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s',)
用户5760343
2022-05-13
3930
python metaclass ..
关于Python2.x中metaclass这一黑科技,我原以为我是懂的,只有当被打脸的时候,我才认识到自己too young too simple sometimes native。
用户5760343
2019-12-13
5500
python 类装饰器与元类
def check_attributes(**kwargs): def decorate(cls): for key, value in kwargs.items(): if isinstance(value, Descriptor): value.name = key setattr(cls, key, value) else: setattr(cls, key, value(key)) return cls
用户5760343
2019-12-13
8680
Docker 生产环境实践2
1、3台主机:1台管理机、2台主机、1台日志服务器 管理机上ansible、配置文件、仓库、监控 2台主机安装keepalived 3台主机打通网络 1台日志服务器,原来用splunk+rsyncd收集,后改成elk。 日志服务器备份DB数据 keepalived,redis,java,tomcat,nginx,mysql zabbix,elk
用户5760343
2019-12-13
4130
python 参数可选的装饰器
from functools import wraps, partial import logging
用户5760343
2019-12-12
9980
python 带参数的装饰器
from functools import wraps import logging
用户5760343
2019-12-12
2K0
python 可自定义属性的装饰器
引入一个访问函数,使用 nonlocal 来修改内部变量。 然后这个访问函数被作为一个属性赋值给包装函数。
用户5760343
2019-12-12
1.4K0
python 用装饰器重写类的方法
def log_getattribute(cls): # Get the original implementation orig_getattribute = cls.getattribute
用户5760343
2019-12-12
1.3K0
python 元类做类型检查
class NoMixedCaseMeta(type): def new(cls, clsname, bases, clsdict): for name in clsdict: if name.lower() != name: raise TypeError('Bad attribute name: ' + name) return super().new(cls, clsname, bases, clsdict)
用户5760343
2019-12-12
5960
Docker 日志管理
日志管理 image.png docker logs -f xxx logging driver docker info|grep "Logging Driver" image.png 在docker
用户5760343
2019-10-08
7840
python 函数
None <code object tag at 0x000001902D2EA1E0, file "D:/file/python/today/today.py", line 1> ('name', 'cls', 'content', 'attrs') 1
用户5760343
2019-08-02
7310
python tag生成html标签脚本
def tag(name, *content, cls=None, **attrs): """生成一个或多个HTML标签""" if cls is not None: attrs['class'] = cls if attrs: attr_str = ''.join(' %s="%s"' % (attr, value) for attr, value in sorted(attrs.items())) else: attr_str = '' if content: return '\n'.join('<%s%s>%s</%s>' % (name, attr_str, c, name) for c in content) else: return '<%s%s />' % (name, attr_str)
用户5760343
2019-08-02
1.1K0
python 获取函数的相关信息
def tag(name, *content, cls=None, **attrs)->str: """生成一个或多个HTML标签""" if cls is not None: attrs['class'] = cls if attrs: attr_str = ''.join(' %s="%s"' % (attr, value) for attr, value in sorted(attrs.items())) else: attr_str = '' if content: return '\n'.join('<%s%s>%s</%s>' % (name, attr_str, c, name) for c in content) else: return '<%s%s />' % (name, attr_str)
用户5760343
2019-08-02
5710
python apscheduler 打印日志
logging.basicConfig() logging.getLogger('apscheduler').setLevel(logging.DEBUG)
用户5760343
2019-07-05
3.1K0
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档