5n6r

Hot tiny Web Server!

Jan 13th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. +---------------------------------+
  2. | for tests  http:/localhost:8888 |
  3. +---------------------------------+
  4. #!/usr/bin/env python3
  5. import os, sys
  6. from http.server import HTTPServer, CGIHTTPRequestHandler
  7. webdir="."
  8. port=8888
  9. os.chdir(webdir)
  10. srvraddr=("",port)
  11. srvrobj=HTTPServer(srvraddr,CGIHTTPRequestHandler)
  12. srvrobj.serve_forever()
Advertisement
Add Comment
Please, Sign In to add comment