使用python连接redis
2017-05-21 14:33
417 查看
import redis host = "127.0.0.1" port = 6379 password = "" db = 15 class CrazyRedis(object): def __init__(self): self.__client__ = redis.Redis( host=host, port = port, password=password, ) print ("init") def lpush(self,key,value): return self.__client__.lpush(key,value) if __name__=="__main__": print ("yes") c = CrazyRedis() c.lpush("b","v") print ("yes")
相关文章推荐
- 关于python语言使用redis时,连接是否需要关闭的问题
- Liunx 上面使用Python连接Redis遇到的一些问题
- 使用Python连接redis(redis作MQ使用)_Tister的空间_百度空间
- 使用Python连接redis(redis作MQ使用)
- redis的安装使用以及python连接redis
- linux下使用python连接redis
- 无法使用jedis连接远程服务器上的redis解决方案ENIED Redis is running in protected mode because prot
- redis集群 - 使用php连接redis集群、redis自定义命令封装
- 【python】python redis的安装与使用
- (linux)python之setuptools、easyinstall、pip安装及连接redis
- [Python] - No.1 使用python3连接Mysql 数据库
- python操作redis之连接reids
- Python 3.2: 使用pymysql连接Mysql
- python连接mysql ,使用对象,进程、线程、协成
- 使用Python操作Redis
- 【Python连接SQL Server数据库】-pymssql使用基础
- Python连接Redis配置详解
- 【Python Oracle】使用cx_Oracle 连接oracle的简单介绍
- Python的Flask框架使用Redis做数据缓存的配置方法
- python字符串连接也可以使用print时用到的方法