kynikos / lib.py.configfile

Python library to dynamically parse and edit configuration files with support for subsections.
https://kynikos.github.io/lib.py.configfile/
MIT License
2 stars 1 forks source link

Example for changing the _OPTION_SEP from " = " to "=" #29

Open Marcuzzz opened 4 years ago

Marcuzzz commented 4 years ago

Hi,

Quick question: Can you give an example for changing the _OPTION_SEP from " = " to "="

config = ConfigFile("thefile.cfg") config["Name"] = "value" config.export_reset("thefile.cfg",_OPTION_SEP='=')

kynikos commented 4 years ago

Hi, you can try this:

from configfile import ConfigFile, Section

Section._OPTION_SEP = "="

config = ConfigFile("thefile.cfg")
config["Name"] = "value"
config.export_reset("thefile.cfg")