S
S.Ramaswamy
I am trying unsuccessfully to set the order of options using the
set(section,option,value) method ( Python 2.2.2) and writing to a
file. But the options always appear in a random order. Before each
option I am writing a comment line using set(section,"#",value) - a
one line explanation for the option that follows - but the comments
get re-ordered randomly.
------------------------------------------------------------------------------------
cfg.add_section("COOL")
cfg.set("COOL","#","This is option A001")
cfg.set("COOL","A001","1")
cfg.set("COOL","#","This is option B001")
cfg.set("COOL","B001","2")
cfg.set("COOL","#","This is option C001")
cfg.set("COOL","C001","3")
cfg.write(file)
-------------------------------------------------------------------------------------
The comments for the options get jumbled up - I want them to be
written before the option=value line. Instead the comments for options
A001,B001,C001 all get ordered randomly.
Any help in getting the sections to be written in order will be
appreciated.
srsy
-
set(section,option,value) method ( Python 2.2.2) and writing to a
file. But the options always appear in a random order. Before each
option I am writing a comment line using set(section,"#",value) - a
one line explanation for the option that follows - but the comments
get re-ordered randomly.
------------------------------------------------------------------------------------
cfg.add_section("COOL")
cfg.set("COOL","#","This is option A001")
cfg.set("COOL","A001","1")
cfg.set("COOL","#","This is option B001")
cfg.set("COOL","B001","2")
cfg.set("COOL","#","This is option C001")
cfg.set("COOL","C001","3")
cfg.write(file)
-------------------------------------------------------------------------------------
The comments for the options get jumbled up - I want them to be
written before the option=value line. Instead the comments for options
A001,B001,C001 all get ordered randomly.
Any help in getting the sections to be written in order will be
appreciated.
srsy
-