zl程序教程

您现在的位置是:首页 >  后端

当前栏目

windows 下为Python安装redis

2023-09-14 09:00:01 时间

最近在看《redis实战》,里面的redis示例都是Python写的,先将环境整好

启动redis

redis-server.exe  redis.conf

安装了python2.7

 

安装了pip

 

安装redis python客户端

pip install redis

查看安装是否成功

pip list

测试

新建hello.py

import redis
r = redis.Redis(host='127.0.0.1',port=6609,db=0)
r.set('hello','world')
print(r.get('hello'))

或者在控制台直接测试