03 2023 档案

摘要:下载依赖包:pip3 install pika 封装公共方法 import pika import json class RaMqStart(object): def __init__(self,url,user,pwd,vhost,queue,key,exchange): # 初始化数据 ''' 阅读全文
posted @ 2023-03-29 11:28 小哈别闹 阅读(46) 评论(0) 推荐(0) 编辑
摘要:首先需要下载依赖包:pip3 install redis import redis conn = redis.Redis(host="配置的host", port=配置的端口) print(conn.set('key','111')) #写入数据 print(conn.get('local_key' 阅读全文
posted @ 2023-03-29 11:17 小哈别闹 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#装饰器 函数嵌套函数 行程闭包 举个例子: import time def time_it(war): def time_ti(): aa = "开始"+ str(int(time.time())) print(aa) war() bb = "结束"+ str(int(time.time())) 阅读全文
posted @ 2023-03-17 09:43 小哈别闹 阅读(10) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示