redis quick start

软件:

redis server https://github.com/MicrosoftArchive/redis/releases

redis python client, install using pip

 

步骤:

编写如下测试程序1.py

#https://pypi.org/project/redis/
#server https://github.com/MicrosoftArchive/redis/releases

import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
r.set('foo', 'bar')
print(r.get('foo'))
print(r.get('NA'))

执行redis-server.exe

执行python 1.py

输出

 

posted on 2018-06-11 23:26  cutepig  阅读(148)  评论(0编辑  收藏  举报

导航