2006-01-12, 00:36
i'm not concerned about key names having spaces but rather the dictionary name itself.
since each system will have a varying number of events/devices, and each event/device will have a separate dictionary... i want to name the dictionary for each using the evetn/device name.
so...
devicename = "kitchen ceiling lights"
dictionary name = dict_kitchen+ceiling+lights
i'm assuming that the dictionary name cannot have spaces.
so the question is... how do i read in the devicename and assign that string text to be the name of the dictionary for that event/device?
my iniial thought is something like this but i'm not sure it would actuallty create a dictionary called 'dict_kitchen+ceiling+lights'...
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]}]
dictdevices[item[0],'dict_'+devdictname]
since each system will have a varying number of events/devices, and each event/device will have a separate dictionary... i want to name the dictionary for each using the evetn/device name.
so...
devicename = "kitchen ceiling lights"
dictionary name = dict_kitchen+ceiling+lights
i'm assuming that the dictionary name cannot have spaces.
so the question is... how do i read in the devicename and assign that string text to be the name of the dictionary for that event/device?
my iniial thought is something like this but i'm not sure it would actuallty create a dictionary called 'dict_kitchen+ceiling+lights'...
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]}]
dictdevices[item[0],'dict_'+devdictname]