On 1/31/06, Tony Meyer <t-meyer at ihug.co.nz> wrote: > Why doesn't this work? It does here: > > $ cat suite.ini > [sect] > opt1 = 1 > opt2 = 2 > $ cat app.ini > [sect] > opt1 = 3 > opt4 = 5 > $ python > Python 2.4.1 (#2, Mar 31 2005, 00:05:10) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import ConfigParser > >>> c = ConfigParser.ConfigParser() > >>> c.read(("suite.ini", "app.ini")) > ['suite.ini', 'app.ini'] > >>> c.sections() > ['sect'] > >>> c.options("sect") > ['opt4', 'opt2', 'opt1'] > >>> c.get("sect", "opt1") > '3' > > Or do you mean something else? Err. Because I missed the fact that read() method takes multiple filenames? There's even a specific explanation of how to load defaults and then override them with optional files. I don't know how I missed that. Thanks for pointing it out. (The whole day's been like that - I'm not sure why I get out of bed sometimes....:-) Paul.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4