《2018年8月17日》【连续319天】
标题:Redies存储;
内容:
准备:
1.安装Redies库:
https://github.com/MicrosoftArchive/redis/releases
推荐Redis Desktop Manager
下载:https://redisdesktop.com/download 或https://github.com/uglide/RedisDesktopManager/releases
2.redis-py库:
pip3 install redis
3.ReiesDump库:
要先安装ruby:http://www.ruby-lang.org/zh_cn/documentation/installation/
windows系统一般下载RubyInstaller:
gem安装:gem install redis-dump
验证:执行命令redis-dump,redis-load,成功调用,则安装成功;
使用:
连接Redis:
from redis import StrictRedis
redis =StrictRedis(host='localhost',port=6379,db=0,password='')
redis.set('name','Bob')
print(redis.get('name'))
成功输出:b'Bob'