[Zope] what is wrong with this code

Andreas Jung andreas at andreas-jung.com
Fri Oct 3 12:31:41 EDT 2003


PythonScript are *never* defined with "def ...". Check the ZopeBook
for examples.

-aj

--On Freitag, 3. Oktober 2003 16:20 Uhr -0400 Jianping Zhu 
<jzhu at fisher.forestry.uga.edu> wrote:

>
>#### python code: example
> def hello(name="dad",age=29):
>
>    return "Hello %s you are %d years old" % (name ,age)
>
>
>
>
>### Page template  testexample
> <html>
> <boddy>
>
> <h2>
> <span
> tal:replace="python:here.example.hello(name='daughter',age=6)"></span>
> </h2>
> </body>
> </html>
> 	
> when I test testexample i got something like
>
> Zope Error
> Zope has encountered an error while publishing this resource.
>
> Error Type: AttributeError
> Error Value: hello
>
> I was expecting, hello daughter your age is 6
> How can I fx this problem? thanks
>
>
> 	
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )







More information about the Zope mailing list