公告板
版本库
filestore
活动
搜索
登录
main
/
python_wechat_helper
Python视频号助手
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
功能完善
admin
2025-04-02
91b7ec2b67d74e4d2e41c857232414feb3cb7bfd
[python_wechat_helper.git]
/
tool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def singleton(cls):
"""
单例装饰器
@param cls:
@return:
"""
instances = {}
def get_instance(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
return instances[cls]
return get_instance