-
1234
michael@ubuntu:~$ wget -q http:
//peak
.telecommunity.com
/dist/ez_setup
.py
michael@ubuntu:~$
sudo
python ez_setup.py
michael@ubuntu:~$
sudo
python -m easy_install redis hiredis
michael@ubuntu:~$ pythonPython 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3] on linux2Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
-
1
>>>
import
redis
-
1
>>> conn = redis.Redis()
-
1
>>> conn.
set
(
'name'
,
"Tom"
)True
-
1
>>> conn.get(
'name'
)
-
1
'Tom'
-
1
>>>
本文转自 yuanzhitang 51CTO博客,原文链接:http://blog.51cto.com/yuanzhitang/1782318,如需转载请自行联系原作者