ConfigObj will read and write list values. You get all sorts of other advantages as well (nested subsections to any depth), and the resulting code will be much simpler.
from configobj import ConfigObj cfgfile = "cfgtest.ini" cfg = ConfigObj(cfgfile) t1 = range(1,11) # no *need* to create a subsection cfg['test'] = {} cfg['test']['testlist'] = t1 cfg.write() To read it back in : from configobj import ConfigObj cfgfile = "cfgtest.ini" cfg = ConfigObj(cfgfile) print cfg['test']['testlist'] http://www.voidspace.org.uk/python/configobj.html All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list