I am going through the Learn Python the Hard Way, 2nd Edition book. I
am trying to create a basic template but I keep getting errors.
Here's my app.py:
import web

urls = (
    '/', 'Index'
)

app = web.application(urls, globals())

render = web.template.render('templates/')

class Index(object):
    def GET(self):
        greeting = "Hello World"
        return render.index(greeting = greeting)

if __name__ == "__main__":
    app.run()

Here's my index.html:
$def with (greeting)



<html>

    <head>

        <title>Gothons of Planet Percal #25</title>

    </head>

<body>



$if greeting:

    I just wanted to say <em style="color: green; font-size: 2em;">
$greeting</em>.

$else:

    <em>Hello</em>, world!



</body>

</html>

I get back a long traceback with

File "C:\Python27\lib\compiler\transformer.py", line 167, in
compile_node
    raise WalkerError, ('unexpected node type', n)
WalkerError: ('unexpected node type', 339)

at the end.
What is going on and how do I fix it?

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to