redis 支持多种语言,其中python最为简洁优雅,以下将python配置成redis的客户端
安装redis库
>>> from urllib import urlopen
>>> data = urlopen('http://peak.telecommunity.com/dist/ez_setup.py')
>>> open('ez_setup.py', 'wb').write(data.read())
>>> exit()
python ez_setup.py
python -m easy_install redis
Hello, Redis
import redis
conn = redis.Redis()
conn.set('Hello', 'Redis')
print conn.get('Hello')