Skip to content

Instantly share code, notes, and snippets.

@adaptives
Created October 5, 2011 07:46
Show Gist options
  • Save adaptives/1263890 to your computer and use it in GitHub Desktop.
Save adaptives/1263890 to your computer and use it in GitHub Desktop.
LPTHW Exercise 50
import web
urls = (
'/', 'index'
)
app = web.application(urls, globals())
render = web.template.render('templates')
class index:
def GET(self):
greeting = "Hello"
return render.index(greeting = greeting)
if __name__ == "__main__":
app.run()
$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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment