Home > php教程 > php手册 > Python 操作 Redis

Python 操作 Redis

WBOY
Release: 2016-06-06 20:00:35
Original
1229 people have browsed it

安装 pip install redis 实例 import redis r = redis.StrictRedis(host='localhost', port=6379, db=0[, password='foo']) # 连接池 pool = redis.ConnectionPool(host='localhost', port=6379, db=0, password='foo') r = redis.Redis(connection_pool=poo

安装

      pip install redis


实例

     import redis


     r = redis.StrictRedis(host='localhost', port=6379, db=0[, password='foo'])


     # 连接池
     pool = redis.ConnectionPool(host='localhost', port=6379, db=0, password='foo')
     r = redis.Redis(connection_pool=pool)


     r.set('foo', 'bar')
     r.get('foo')


来源:https://pypi.python.org/pypi/redis

请关注

Python 操作 Redis


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template