python3连接redis数据库
1.python想操作redis,需要安装第三方模块(我是在windows下进行操作的)
pip install redis

2.连接数据库
#coding:utf-8import redisr = redis.Redis(host='127.0.0.1', port=6379)#host后的IP是需要连接的ip,本地是127.0.0.1或者localhostr.set('name', 'test')print(r.get('name'))# 输出结果b'test'

浙公网安备 33010602011771号