code: def write(self, fp):
          
          if self._defaults:
              fp.write("[%s]\n" % ConfigParser.DEFAULTSECT)
              for (key, value) in sorted(self._defaults.items(), key=lambda x: x[0]):
                  fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
              fp.write("\n")
          for section in sorted(self._sections):
              fp.write("[%s]\n" % section)
              for (key, value) in sorted(self._sections[section].items(), key=lambda x: x[0]):
                  if key != "__name__":
                      fp.write("%s = %s\n" %
                               (key, str(value).replace('\n', '\n\t')))
              fp.write("\n")
docs: Write an .ini-format representation of the configuration state.