When I add a new option to a section and write the file to config it always seems to duplicate the section and adds the new one with the new option.
Ideally I'd like to avoid this and only have one section, how do I achieve this?
Example occurrence
config.add_section("Install")
config.set("Install", "apt_installer", "True")
cfile = open("file.cfg", "w")
config.write(cfile)
cfile.close()
config.read("file.cfg")
config.set("Install", "deb_installer", "True")
cfile = open("file.cfg", "a")
config.write(cfile)
cfile.close()
When you open file.cfg it then has Install twice one with apt_installer and the other with both apt_installer and deb_installer. Any advice anyone can give I'd appreciate it.