Skip to content

Instantly share code, notes, and snippets.

@santiago-salas-v
Last active December 1, 2017 19:39
Show Gist options
  • Save santiago-salas-v/ce8dee1d1acda33e682d424be114d7a0 to your computer and use it in GitHub Desktop.
Save santiago-salas-v/ce8dee1d1acda33e682d424be114d7a0 to your computer and use it in GitHub Desktop.
simple web server for VisualMathEditor: visualmatheditor.equatheque.net/
from http import server
import socketserver
import webbrowser
import threading
class ThreadingServer(socketserver.ThreadingMixIn, server.HTTPServer):
pass
PORT = 8000
handler = server.SimpleHTTPRequestHandler
httpd = ThreadingServer(('', PORT), handler)
print('serving at port', PORT)
t = threading.Thread(target=httpd.serve_forever)
t.start()
print('opening editor')
url = 'http://localhost:8000/VisualMathEditor.html'
br = webbrowser.open_new(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment