Advertisement
Guest User

Untitled

a guest
Apr 29th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from wsgiref.util import setup_testing_defaults
  2. from wsgiref.simple_server import make_server
  3. import web
  4.  
  5. urls = (
  6.     '/(.*)', 'hello'
  7. )
  8. app = web.application(urls, globals())
  9.  
  10. class hello:        
  11.     def GET(self, name):
  12.         if not name:
  13.             name = 'World'
  14.         return 'Hello, ' + name + '!'
  15.  
  16. #app = web.application(urls, globals(), autoreload=False)
  17. application = app.wsgifunc()
  18.  
  19. httpd = make_server('', 8000, application)
  20. print "Serving on port 8000..."
  21. httpd.serve_forever()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement