Good day! There is a code like:
from configobj import ConfigObj spec = """ example = boolean(default=True) [section1] value1 = [value1] value2 = integer(default=15) """ from StringIO import StringIO config = ConfigObj(configspec=StringIO(spec)) from validate import Validator config.validate(Validator(), copy=True) config.filename = 'test.conf.sample' config.write() Actually the question is: how to substitute your variables when generating a config so that it is something like this:
example = boolean(default=True) TEST value1 = test value2 = integer(default=15) Tried to do so
config['section1'] = 'TEST' config['value1'] = "test" But nothing works, what could be the problem? Thanks in advance for your help!
config.write()after changing parameters. - Daniyar Supiev