Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jeffbryner/configlib

simple python wrapper for .conf file get, set, delete operations.
https://github.com/jeffbryner/configlib

Last synced: 11 days ago
JSON representation

simple python wrapper for .conf file get, set, delete operations.

Awesome Lists containing this project

README

        

configlib
=========

simple python wrapper for .conf file get, set, delete operations.

Use thusly:

.conf file:
```
[options]
somesetting=aDifferentValue

```

python code:
```
from configlib import getConfig,OptionParser
def initConfig():
#initialize config options
#sets defaults or overrides from config file.
options.something=getConfig('somesetting','defaultvalue',options.configfile)

if __name__ == "__main__":
parser=OptionParser()
parser.add_option("-c", dest='configfile' , default='', help="configuration file to use")
(options,args) = parser.parse_args()
initConfig()
```

pip install configlib