[Python-Dev] ConfigParser with a single section (original) (raw)
Guido van Rossum guido@python.org
Fri, 08 Nov 2002 11:55:44 -0500
- Previous message: [Python-Dev] ConfigParser with a single section
- Next message: [Python-Dev] Reindenting unicodedata.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Unfortunately I cannot easily supply the section line when parsing the config file, even if I use ConfigParser.readfp(); the "obvious solution"
prefix = cStringIO.StringIO("[Options]\n") cfp = ConfigParser.ConfigParser() cfp.readfp(prefix, filename) cfp.read(filename) doesn't work because the ConfigParser object expects a new section header for each read*() call.
So copy everything into one memory buffer.
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] ConfigParser with a single section
- Next message: [Python-Dev] Reindenting unicodedata.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]