Created
June 10, 2013 18:35
-
-
Save anandology/5751099 to your computer and use it in GitHub Desktop.
helloworld script to try web.py on Python3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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