[Zope] Why Doesn't This Python Expr. Work?

beno zope@thewebsons.com
Fri, 03 Jan 2003 10:29:21 -0400


Hi;

If I type this at the Python command prompt, I get the following:

 >>> import string
 >>> template_id = "x_frame"
 >>> if (string.find(template_id,'frame')==-1):
...  template_id = template_id + '_frame'
...
 >>> content = 'here/' + template_id + '_content/macros/content'
 >>> print content
here/x_frame_content/macros/content
 >>> template_id = "x"
 >>> if (string.find(template_id,'frame')==-1):
...  template_id = template_id + '_frame'
...
 >>> content = 'here/' + template_id + '_content/macros/content'
 >>> print content
here/x_frame_content/macros/content
 >>>

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". Why?
beno