list to dict?

Marco Barisione marco.bari at vene.ws
Thu Mar 13 12:12:36 CET 2003


On Wed, 12 Mar 2003 04:00:57 GMT, Raymond Hettinger wrote:

>>>> d = {}
>>>> for pair in s:
>              key, value = pair.split("=")

"pair.split('=', 1)" is better as it works even if there are two "=" in the 
string.


-- 
Marco Barisione
http://spazioinwind.libero.it/marcobari/




More information about the Python-list mailing list