Skip to content

Instantly share code, notes, and snippets.

@aza
Created May 17, 2011 01:03
Show Gist options
  • Save aza/975684 to your computer and use it in GitHub Desktop.
Save aza/975684 to your computer and use it in GitHub Desktop.
import os
import BaseHTTPServer
import SimpleHTTPServer
PORT = 8000
def run(server_class=BaseHTTPServer.HTTPServer,
handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler,
port=PORT):
server_address = ('', port)
print "Serving files in '%s' on port %d." % (os.getcwd(), port)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()
if __name__ == '__main__':
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment