converting string to dict ?

Aahz Maruch aahz at panix.com
Wed Apr 11 19:28:39 EDT 2001


In article <td8bji613hivc6 at corp.supernews.com>,
Jason Cunliffe <jasonic at nomadicsltd.com> wrote:
>
>A web input form  passes {'name':'Cleopatra'} as a string.
>Please, is there a nice clean function to convert this string to a dict?

Redesign your web form.  Seriously.  At the very least, change this to
use a single delimiter between key and value, such as 

    name/Cleopatra

More conversion work (slightly), but much, much, much safer.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het Pythonista   http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Why is this newsgroup different from all other newsgroups?



More information about the Python-list mailing list