Skip to content

Instantly share code, notes, and snippets.

@phaufe
Forked from omz/FileBrowser.py
Created January 26, 2013 16:04
Show Gist options
  • Save phaufe/4643043 to your computer and use it in GitHub Desktop.
Save phaufe/4643043 to your computer and use it in GitHub Desktop.
import SimpleHTTPServer
import SocketServer
import webbrowser
import os
os.chdir('/')
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", 0), Handler)
port = httpd.server_address[1]
webbrowser.open('http://localhost:' + str(port), stop_when_done=True)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment