On Feb 18, 2007, at 12:44 AM, mahdieh saeed wrote:
I want to convert string to dictionary .what is the best solution for this ?
for example string is like this:

'{"SalutationID":["primarykey",8388607,0,None],"CompanyID": [0,8388607,0,"index"],
 "SalutationName":["",255,0,None],"isDefault":["tinyint",1,1,None]}'

and I want to convert this string to this dictionary:

{"SalutationID":["primarykey",8388607,0,None],"CompanyID": [0,8388607,0,"index"],
 "SalutationName":["",255,0,None],"isDefault":["tinyint",1,1,None]}

# you're the one building the string?
a = eval('{"SalutationID":["primarykey",8388607,0,None],"CompanyID": [0,8388607,0,"index"],
 "SalutationName":["",255,0,None],"isDefault":["tinyint",1,1,None]}')

---
A clever person solves a problem.
A wise person avoids it.
                                            -Albert Einstein




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to