[Tutor] embedding lists in configuration files

Kent Johnson kent37 at tds.net
Thu Oct 12 23:09:40 CEST 2006


William O'Higgins Witteman wrote:
> I am looking for a way to use a plain text configuration file in a
> Python program instead of hard-coded values.  The configuration data
> currently is in the form of a couple of lists and some triple-quoted
> strings.
> 
> I was looking at the ConfigParser module, but I cannot see how to use
> this format to represent lists or triple-quoted strings.  Are there any
> other suggestions?  Thanks.

ConfigObj supports lists and triple-quoted strings directly:
http://www.voidspace.org.uk/python/configobj.html

Kent



More information about the Tutor mailing list