ConfigParser module and alternatives (flad, flan)
Brad Howes
bhowes at cssun3.corp.mot.com
Mon Apr 12 16:22:44 EDT 1999
>>>> Thus spake 'Jim Meier (fatjim at home.com)':
JM> Mike Orr wrote:
>> I'm not sure if I'll use ConfigParser for the next version. I don't
>> really need the sections (multiple files work just fine, using the filename
>> for the section name), and I haven't found a use for the the %(other_key)s
>> substitutions. On the other hand, it doesn't handle multiple values (the
>> same key repeated within a record), which I sometimes need.
>>
>> Attached is a wrapper class for ConfigParser which supports booleans
>> and can also return an entire section as a dictionary (or all the sections
>> as nested dictionaries). I find these make it a little more convenient.
>>
JM> Why not simply use a file of python expressions? Like this:
Or classes (which is what I've used in several apps):
class Section1:
key1 = [ 1, 2, 3, 'value', [ 'useful, 'nesting', 'eh?' ] ]
key2 = 'anotherval'
--
Brad Howes bhowes at motorola.com
Principal Compass Hacker Work: +1 602 446 5219
Motorola Cell: +1 602 768 0735
More information about the Python-list
mailing list