Searching a large dictionary

Chris Rebert clp2 at rebertia.com
Tue Sep 22 18:35:55 EDT 2009


> On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert <clp2 at rebertia.com> wrote:
>> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk
>> <support.desk.ipg at gmail.com> wrote:
>> > I need help searching a large python dictionary. The dictionary is setup
>> > like so
>> >
>> >
>> > Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}]
>> >
>> >
>> > Key2[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}]
>> >
>> >
>> > Key3[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}]
>>
>> That is not valid syntax. Do you mean you have a dictionary like this?:
>>
>> { Key :
>> [{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}],
>> Key2 :
>> [{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}],
>> Key3 :
>> [{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}]
>> }
On Tue, Sep 22, 2009 at 3:30 PM, Support Desk
<support.desk.ipg at gmail.com> wrote:
> Chris,  Yes that is the correct syntax, thanks

Ok, so what would the new dictionary you want look like exactly? A
list would seem the natural datatype for the results, but you want a
dict.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list