Re: Search in list of dictionaries

2009-02-19 Thread Alex Gusarov
Thanks! This example is quite simple and works exactly the way I wanted. On Thu, Feb 19, 2009 at 11:39 PM, MRAB wrote: > Alex Gusarov wrote: > >> Hello everybody! >> >> I've a list of dictionaries with 'shorcut' and 'command' keys. When user >> types a word program must search this list for a ty

Re: Search in list of dictionaries

2009-02-19 Thread MRAB
Alex Gusarov wrote: Hello everybody! I've a list of dictionaries with 'shorcut' and 'command' keys. When user types a word program must search this list for a typed shortcut and then run linked command. What I've wrote: for cmd in self.commands: if cmd['shortcut'] == inpu