import web urls hello app web application urls globals class hello def

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
if not name:
name = 'world'
return 'Hello, ' + name + '!'
if __name__ == "__main__":
app.run()