Source

pyptug / webpy / helloworld / hw3.py

#!/usr/bin/env python
""" A real hello world web application using web.py """

import web

# setting up an auto web app
app = web.auto_application()


class hello(app.page):
    path = "/hello/([a-zA-Z -]*)"
    def GET(self, name):
        if name =="":
            return 'Hello, World!'
        else:
            return 'Hello ' + name


class goodbye(app.page):
    def GET(self):
        return 'Goodbye, World!'

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