Python-链接Redis

首先需要下载依赖包: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  小哈别闹  阅读(17)  评论(0)    收藏  举报