Re: Searching a large dictionary

2009-09-23 Thread Rhodri James
On Thu, 24 Sep 2009 01:03:26 +0100, Sean DiZazzo wrote: I like to perform what I call "objectify" on nested dictionary type stuff into classes. class TestPart(object): def __init__(self, **kwargs): for k,v in kwargs.items(): setattr(self, k, v) [snip]

Re: Searching a large dictionary

2009-09-23 Thread Martien Verbruggen
On Wed, 23 Sep 2009 14:52:56 -0700 (PDT), mike171562 wrote: > Sorry for the confusion, Simon, this is almost exactly what I need, > but i need to be able to search for a string in a given value of an > item > > Here is an example of the dict I am working with > > {'252': [{'code': '51679',

Re: Searching a large dictionary

2009-09-23 Thread Sean DiZazzo
On Sep 23, 4:05 pm, "Rhodri James" wrote: > On Wed, 23 Sep 2009 22:52:56 +0100, mike171562   > > wrote: > > Sorry for the confusion, Simon, this is almost exactly what I need, > > but i need to be able to search for a string in a given value of an > > item > > > Here is an example of the dict I a

Re: Searching a large dictionary

2009-09-23 Thread Rhodri James
On Wed, 23 Sep 2009 22:52:56 +0100, mike171562 wrote: Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01

Re: Searching a large dictionary

2009-09-23 Thread mike171562
Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01 11:35:38', 'userfield': '252', 'from': '9876662881', 'to': '

Re: Searching a large dictionary

2009-09-23 Thread mike171562
i am trying to search a large Python dictionary for a matching value. The results would need to be structured into a new dictionary with the same structure. Thanks. The structure is like this { Key : [{'item':value,'item2':value,' item3':value,'item4':value,'item5':value','item6':value,'item7':va

Re: Searching a large dictionary

2009-09-22 Thread Dave Angel
Support Desk 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,

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
> -Original Message- > From: Chris Rebert > Sent: Tuesday, September 22, 2009 5:35 PM > To: Support Desk > Cc: python-list@python.org > Subject: Re: Searching a large dictionary >> On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >>> On Tue, Sep

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
> On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk >> 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','i

Re: Searching a large dictionary

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 6:30 PM, Support Desk wrote: > Chris,  Yes that is the correct syntax, thanks > Okay, but correct syntax of what? Help us help you. > On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >> >> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk >> wrote: >> > I need help se

Re: Searching a large dictionary

2009-09-22 Thread Support Desk
Chris, Yes that is the correct syntax, thanks On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: > On Tue, Sep 22, 2009 at 2:50 PM, Support Desk > wrote: > > I need help searching a large python dictionary. The dictionary is setup > > like so > > > > > Key[{'item':value,'item2':value,'item3'

Re: Searching a large dictionary

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 5:50 PM, Support Desk 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,

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
On Tue, Sep 22, 2009 at 2:50 PM, Support Desk 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,