[mod_python] syntax errors

Jim Gallacher jpg at jgassociates.ca
Wed May 10 00:02:34 EDT 2006


David Bear wrote:
> I'm using psp handler like this:
> 
> <Directory "/www/htdocs/psp">
>  AddHandler mod_python .psp
>  PythonHandler mod_python.psp
>  PythonDebug On
> </Directory>
> 
> my html.psp file contains a simple exercise from onlamp demonstrating
> psp and looks like this:
> 
> 
> <html>
>  <head>
>    <title>A psp test </title>
>  </head>
>  <body>
> <% 
> if form.has_key('name'):
>    greet = 'Hellow %s ' % form.['name'].capitalize()

     greet = 'Hellow %s ' % form.['name'].capitalize()

                                 ^

SyntaxError: invalid syntax


Pretty much what the traceback tells ya. Try this:

    greet = 'Hellow %s ' % form['name'].capitalize()

Jim




More information about the Mod_python mailing list