[Zope] dictionary definition and strings

hans hans@beehive.de
Thu, 04 Apr 2002 11:08:40 +0100


"p.t." wrote:

> If, in a python script, I have a string ="{'aKey':'aValue'}" and I want to
> generate a dictionary from such a string, what should I do?

in normal python (Products, ExternalMethod), eval( yourstring ) would do.
in Thru The Web objects (DTML, PythonScript) you cant use eval.

cheers hans
-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin  (software developer)           hans@beehive.de
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299