list to dict?

Matt Neuber mneuber at attbi.com
Wed Mar 12 03:59:16 CET 2003


This is probably a pretty "newbish" question but...

Say I have a list, and it looks something like
["name=matt","sex=male","age=24"] (etcetera) and I wanted to convert
it to a dictionary: {'name': 'matt', 'sex': 'male', 'age': '24'} and
so forth.
Is there an easy way to do this? I've tried a number of things, but I
have run into problems because of the literals...




More information about the Python-list mailing list