12 Sep
1999
12 Sep
'99
8:57 p.m.
chas wrote:
trivial no doubt, but buggered if i can find the python equivalent for "eval". eg. how would you rewrite this in dtml :
for i in range(1,6) : print (eval('var%s' % i))
<dtml-in "_.range(1,6)"> <dtml-var "_['var'+_['sequence-item']]"> </dtml-in> or, since you're a PythonMethods fan, for i in range(1,6): print _['var%s' % i] Thanks for the kudos, by the way. As for the use of tabs in PythonMethod code, my advice is: DON'T. Hit the spacebar 2 or 4 times instead; you'll be glad you did. FTP only works for FTP-enabled classes, which AFAIK only includes DTML objects. Patches are welcome, of course <wink>.