import web
urls = (
' /hello ', ' Index '
)
app = web.application(urls, globals())
render = web.template.render('templates/')
class Index(object):
def GET(self):
form = web.input(name = 'Nobody' )
greeting = 'Hello, %s'% form.name
return render.index(greeting = greeting)
if __name__ == '__main__':
app.run()
and -----------------
$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>
Those are the codes which I typed from lpthw book but on running it using bin\app.py, the browser and cmd line output i always get is “not found”. I’ve altered and tried changing the port but the problem is still persistent.