Created
December 2, 2014 00:51
-
-
Save z-------------/8d05102d561476bc96d4 to your computer and use it in GitHub Desktop.
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 sys | |
| from http.server import CGIHTTPRequestHandler, HTTPServer | |
| port = 8000 | |
| if len(sys.argv) > 1: | |
| port = int(sys.argv[1]) | |
| handler = CGIHTTPRequestHandler | |
| handler.cgi_directories = ["/py"] | |
| server = HTTPServer(("", port), handler) | |
| print("Server running on port " + str(port)) | |
| server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment