config parser: Choosing name and value delimiter
问题 Let's say I have one test.ini file with the following lines: [A] name1 [0,1]=0 name2 a:b:c / A:B:C [0,1]=1 When I parse it like this: A = ConfigParser.ConfigParser() with codecs.open('test.ini', 'r') as f: A.optionxform = str A.readfp(f) for section_name in A.sections(): print 'Section:', section_name print 'Options:', A.options(section_name) for name, value in A.items(section_name): print 'name-value pair:' print '%s' % (name) print '%s' % (value) I get the following output: Section: A