ConfigParser & converting strings to lists

JohnJacob noone at here.invalid
Sun Jun 23 01:05:45 EDT 2002


> files = config.get("recent files", "recentFiles")
>
> sets files to the _string_ "[file1, file2, ...]".  I suppose this must
> be how get should work; after all, settings could be arbitrary
> strings...

You just want to get your list back from it's string representaion, right?
Try eval:

files = eval(config.get("recent files", "recentFiles"))



I hope that's what you meant.

greg






More information about the Python-list mailing list