def writeinifile ( self, FILE='P:/INI/test.ini', SECTION='Testsection', OPTION='Item', VALUE='wheeee' ): p = ConfigParser() p.read(FILE) if not p.has_section ( SECTION ): p.add_section(SECTION) p.set(SECTION, OPTION, VALUE)