SnowWalkerJ / config

config manager that allows override by commandline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

config

This package allows you to handle config file easily while allowing you to override settings through commandline params.


Overview

config.cfg:

a = 1
b = 2.2
s = 'abc'

python script test.py:

from config import config
config.add_argument("-c", type=str, default="test")
print(config.a)
print(config.b)
print(config.s)
print(config.c)
python test.py -c def --a 2

Output:

2
2.2
abc
def

The value of config.a is overrided to 2 (it's 1 be default) by commandline

About

config manager that allows override by commandline

License:GNU General Public License v3.0


Languages

Language:Python 100.0%