I'd like to use configuration globally so that many python function can use without read a file every time when it needs
So I have a file app.py
from views.run import runif __name__ == '__main__': run()
config.py
config['db_host'] = 'localhost'config['port'] = '3306'config['user'] = 'root'config['pw'] = 'password'
and views/run.py
def run(): host = config['db_host'] port = config['port'] user = config['user'] pw = config['pw']
views/run1.py
def run1(): host = config['db_host'] port = config['port'] user = config['user'] pw = config['pw']
is there a way to setup the config globally in pythonic way?