2006-01-18, 04:49
right now i've been using try/except but this gets long after two dictionaries.
i found some code on web pages and such but cannot get them to work. any help is appreciated as i need to search multiple dictionaries for keys. yes i know it is not the best way to do it but due to limitations in xbmc button/list functions i have no choice since i need to use dictionaries to efficiently store a lot of data.
here's the code i found but cannot get to work...
i found some code on web pages and such but cannot get them to work. any help is appreciated as i need to search multiple dictionaries for keys. yes i know it is not the best way to do it but due to limitations in xbmc button/list functions i have no choice since i need to use dictionaries to efficiently store a lot of data.
here's the code i found but cannot get to work...
Quote: dict_set = (self.dicthsdevices, self.dicthsevents, self.dicthsbtndevices) <-- creates set of dictionaries
--- code examples to search the set --->
val = [ d for d in dict_set if d[value] in dict_set ]
or
for key, value in dict.iteritems(): pass