At 05:24 PM 1/3/2003 +0100, you wrote:
Am 03.01.2003, 15:29 Uhr schröb beno <zope@thewebsons.com>:
If I type this at the Python command prompt, I get the following: [...] Yet, if I call it from a script, it works just fine for a string similar to "x" but it adds an extra "_frame" for a string similar to "x_frame".
A typo in your script? Works as expected here. One observation: you check for "frame" and append "_frame", if it's missing.
Well, that wasn't the problem. I dinked around with it for a while and finally tried this: import string template_id = template_id[:-4] if (string.find(template_id,'frame')==(0 | -1)): template_id = template_id + '_frame' content = 'here/' + template_id + '_content/macros/content' print content return printed If the value can choose between 0 and -1 it works. Why? I don't know and I don't care ;) beno