Dictionaries in Lists

Terry Reedy tejarex at yahoo.com
Wed Mar 6 16:19:42 EST 2002


"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}

I see 2 syntax errors above.  Show up *exactly* what you entered.
Fire up interactive browser and cut and past result.

> Listing=[]
> Listing.append(Info)

Terry J. Reedy






More information about the Python-list mailing list