码迷,mamicode.com
首页 > Windows程序 > 详细

redis client API

时间:2014-10-15 19:19:01      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:http   io   os   使用   ar   for   sp   div   art   

想知道redis针对各种编程语言推荐的接口API实现,请参考http://redis.io/clients/

选择python语言,则使用https://github.com/andymccurdy/redis-py

Installation

redis-py requires a running Redis server. See Redis‘s quickstart(http://redis.io/topics/quickstart) for installation instructions.

To install redis-py, simply:

$ sudo pip install redis

or alternatively (you really should be using pip though):

$ sudo easy_install redis

or from source:

$ sudo python setup.py install

Getting Started

>>> import redis
>>> r = redis.StrictRedis(host=‘localhost‘, port=6379, db=0)
>>> r.set(‘foo‘, ‘bar‘)
True
>>> r.get(‘foo‘)
‘bar‘

API Reference

The official Redis command documentation does a great job of explaining each command in detail. redis-py exposes two client classes that implement these commands. The StrictRedis class attempts to adhere to the official command syntax. There are a few exceptions:

redis client API

标签:http   io   os   使用   ar   for   sp   div   art   

原文地址:http://www.cnblogs.com/zxpo/p/4026741.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!