Dictionaries in Lists

Avi Homes Moo at houston.rr.com
Thu Mar 7 00:24:42 EST 2002


"j vickroy" <jim.vickroy at noaa.gov> wrote in message
news:a661gr$d2s$1 at mwrns.noaa.gov...
> Nothing wrong with the idea.
>
> Did you specify:
>
> > Info = {'IName':"Voodoo2",'IDescription':"blahblah"}
>
> or what you posted (which had some syntax errors)?
>
> "Avi Homes" <Moo at houston.rr.com> wrote in message
> news:ayvh8.55100$6j2.3265866 at typhoon.austin.rr.com...
> > I was attempting to make a list of dictionaries, which to me feels like
> the
> > C equivlant of an array of structs, kind of. anyway, after making a
> > dictionary and putting some values into it, and trying to append it to a
> > list, python is not liking this. Am I approaching the idea the wrong
way?
> i
> > would like to keep the data organized as dictionaries.. the code looked
> > something like
> >
> > Info{'IName':"Voodoo2",'IDescription':"blahblah}
> > Listing=[]
> > Listing.append(Info)

I was shooting it off of the top of my head, the code is on the student
network which I do not have access to from home.  Anyway, there was an
assignment sign between the Info and {} for the dictionary.  I'll have to
look at the code again, but alas, I'm leaving town today (thursday) and ill
be gone for two weeks. so, I may just end up rewriting the code, because I
know that the idea will work, I can indeed put a list of dictionaries, so
I'll just rewrite it while im on the plane.  thanks guys, and next time ill
have the code with me






More information about the Python-list mailing list