search multiple dictionaries efficiently?

Livin livin at cox.net
Tue Jan 17 21:53:20 EST 2006


I'm a noobie so please be easy on me. I have searched a ton and did not find 
anything I could understand.

I'm using py2.3

I've been using Try/Except but this gets long with multiple 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.



here's the code I found but cannot get to work...

dict_set = (self.dictHSdevices, self.dictHSevents, self.dictHSbtnDevices) 
<-- /creates set of dictionaries/

/code 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







More information about the Python-list mailing list