Commit 1e5c0247 by taoke

修改读取redis

parent c89758d3
import redis,pymysql,enum
import redis,pymysql
# redis类
class RedisBase:
def __init__(self, inum):
"""每一个数据库实例管理一个连接池"""
self.num = inum
pool = redis.ConnectionPool(host='10.197.236.197', port=6379, db=0, password='123456')
pool = redis.ConnectionPool(host='10.197.236.197', port=6379, db=self.num, password='123456')
self.r = redis.Redis(connection_pool=pool)
class RedisString(RedisBase):
......@@ -79,7 +79,9 @@ class MYSQL:
if __name__ == '__main__':
# r= RedisString(6).get('bmc:captcha:40ec9359-a0e8-42a1-b0c0-c19f199cab60')
r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# print(r)
# print(str(r)[-7:-1])
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment