Are you saying that each child dictionary actually has its own 'key', not just the items within it?
The goal is to create a dictionary with many dictionaries in it. - each child dictionary will hold a single 'device' and its related attributes. - I want to name the child dictionaries the same as their device name so it is easy to call them from within the dictionary. - also, they dictionary will be dynamic, thus the # of devices is always changing so they need to be created on-the-fly. "Dan Sommers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 11 Jan 2006 15:53:48 -0700, > "Livin" <[EMAIL PROTECTED]> wrote: > >> I need to dynamically create dictionary names using strings input at >> the time of creation. These will then be placed into a "Parent" >> dictionary. > > Don't do that. > >> item[5]='Kitchen Ceiling Lights' > >> devDictName = item[5].replace(' ','+') >> 'dict_'+devDictName = [{'Group':item[2], 'Status':item[3], >> 'DimLevel':item[4], 'DeviceName':item[5], 'Location':item[6], >> 'HouseCode':item[7], 'LastChange':item[8], 'DeviceType':item[9], >> 'CanDim':item[10], 'Values':item[11]}] > > This is a list that contains one item, and that one item happens to be a > dictionary. Is this really what you want? > >> dictDevices[item[0],'dict_'+devDictName] > > Put the dictionaries you create into another dictionary instead: > > devDict = { } > > key = item[5].replace(' ','+') > > devDict[key] = {'Group':item[2], > 'Status':item[3], # etc. > } > > HTH, > Dan > > -- > Dan Sommers > <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list