python操作redis
import redis
# try:
# pool = redis.ConnectionPool(
# host="192.168.40.71",
# port = 6379,
# password="",
# db=0,
# max_connections=20
# )
# except Exception as e:
# print(e)
class RedisDb:
def __init__(self, ip, port, pwd, db_id):
try:
self.conn = redis.Redis(ip, port, db_id, pwd)
except Exception as e:
print
python操作redis最先出现在Python成神之路。
共有 0 条评论