python 配置导入方式

许多连接,如

from setting import redis_config
pool= redis.ConnectionPool(**redis_config)
r=redis.Redis(connection_pool=pool)

使用**config,可以将json形式的config作为参数使用。

setting

redis_config={
    'host':'',
    'port':2333,
    'decode_responses':True,
    'password':'emazing'
}

猜你喜欢

转载自www.cnblogs.com/huim/p/9720198.html