I'm not quite sure what you mean by nested list here since it looks like you're using dictionaries. I'm going to assume that 'SettingStore' is a dictionary with the keys being sections and the values being dictionaries of options for each section. If this is the case, your code would look something like this:
SettingStore = {} for CFGSection in hConfig.sections(): for CFGOption in hConfig.options(CFGSection): SettingsStore[CFGSection][CFGOption] = hConfig.get(CFGSection,CFGOption)} If I've totally misunderstood your question, just ignore everything I said :-). Reggie Dugard On Mon, 2002-04-15 at 04:55, John Abel wrote: > I apologise if this seems a simple question, but I've checked through > the online docs, and scoured all the sources I know. I'm trying to > append items to a nested list. At first I tried: > > for CFGSection in hConfig.sections(): > for CFGOption in hConfig.options(CFGSection): > SettingsStore[CFGSection] = {CFGOption: > hConfig.get(CFGSection,CFGOption)} > > but that just stores that last item read in. I've looked at append, > but I can't see how to make it append the nested items. > > I'd be grateful for any help. > > Regards > > John > > _______________________________________________ > ActivePython mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ ActivePython mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs