Skip to content

Instantly share code, notes, and snippets.

@aza
Created May 17, 2011
Embed
What would you like to do?
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