Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Set default values to modulename
Keys which start with underscores are ignored

        def module_default(modulename, defaults):
    '''Set default values to modulename
    Keys which start with underscores are ignored'''

    module = __import__(modulename)
    for key in defaults:
        if not key.startswith('_') and not hasattr(module, key):
            setattr(module, key, defaults[key])
        


src/w/a/wakarimasen-HEAD/config_defaults.py   wakarimasen(Download)
# add default values to config.py
import util as _util
_util.module_default('config', locals())