1 2 3 4 5 6 7 8 9 10 11 12
from configparser import SafeConfigParser __all__ = ['config'] scp = SafeConfigParser() def config(option=None, section='webhttp', type=lambda x:x): if option == None: return scp else: return type(scp.get(section, option))