[Zope] python script, from string to dictionary.

Bill Campbell bill at celestial.net
Wed Feb 6 19:28:06 EST 2008


On Thu, Feb 07, 2008, Stefano Guglia wrote:
>hello!
>
>I converted a dictionary in a string, and now I need to change back the
>same string as a dictionary in a zope python script.

s = repr(d)
newdict = eval(s)

Bill
--
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

That rifle on the wall of the labourer's cottage or working class flat is
the symbol of democracy.  It is our job to see that it stays there.
   --GEORGE ORWELL


More information about the Zope mailing list