Skip to content

Instantly share code, notes, and snippets.

@anandology
Created June 10, 2013 18:35
Show Gist options
  • Select an option

  • Save anandology/5751099 to your computer and use it in GitHub Desktop.

Select an option

Save anandology/5751099 to your computer and use it in GitHub Desktop.
helloworld script to try web.py on Python3
import web
web.config.debug = False
urls = (
"/", "hello",
)
app = web.application(urls, globals())
class hello:
def GET(self):
return "hello word\n"
application = app.wsgifunc()
if __name__ == "__main__":
from wsgiref.simple_server import make_server
port = 8080
httpd = make_server('', port, application)
print("http://0.0.0.0:%d/" % port)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment