2 May
2003
2 May
'03
4:55 p.m.
martin f krafft wrote:
how can i use a variable to name another variable before this variable gets expanded? e.g.:
myvar = 14; a = 'myvar'; b = $($a); // b = 14
is this possible with ZPT and/or python?
It is possible with both. In a ZPT: <div tal:define="myvar python:14; a string:myvar; b python:path(a)"> In Python: myvar = 14 a = 'myvar' b = locals()[a] *However*, this will not work in Zope's Python-based Scripts, since they do not allow access to locals(). Cheers, Evan @ 4-am