Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from wsgiref.util import setup_testing_defaults
- from wsgiref.simple_server import make_server
- import web
- urls = (
- '/(.*)', 'hello'
- )
- app = web.application(urls, globals())
- class hello:
- def GET(self, name):
- if not name:
- name = 'World'
- return 'Hello, ' + name + '!'
- #app = web.application(urls, globals(), autoreload=False)
- application = app.wsgifunc()
- httpd = make_server('', 8000, application)
- print "Serving on port 8000..."
- httpd.serve_forever()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement