How to ConfigParse a file keeping multiple values for identical keys?
问题 I need to be able to use the ConfigParser to read multiple values for the same key. Example config file: [test] foo = value1 foo = value2 xxx = yyy With the 'standard' use of ConfigParser there will be one key foo with the value value2 . But I need the parser to read in both values. Following an entry on duplicate key I have created the following example code: from collections import OrderedDict from ConfigParser import RawConfigParser class OrderedMultisetDict(OrderedDict): def __setitem__