爲Python安裝Redis庫


爲Python安裝Redis庫,登錄   https://github.com/andymccurdy/redis-py 後點擊Download ZIP下載安裝包。python

解壓並安裝:git

 

git clone https://github.com/andymccurdy/redis-pygithub

cd redis-pyredis

sudo python ./setup.py installide

 

安裝完成後,就能夠引用redis庫了。utf-8

 

#!/usr/bin/python# -*- encoding: utf-8 -*-import redis

r = redis.Redis(host='127.0.0.1', port=6379)
r.set('foo', 'bar')
print(r.get('foo'))

  // barget

相關文章
相關標籤/搜索