Hi Guys,
Further to my web browser based UI proof of concept thread:
I’ve managed to borrow a Mac Mini from a friend to test/develop for cross platform and I’ve had my first attempts to get a HTML UI up and running.
My code launches a web browser from Rhino fine on MacOS, but the server is not working.
What it looks like the Bengesht http server components are not compatible with MacOS - which is not a surprise as they are really older than the MacOS Rhino.
Not so much of an issue, as I think I can roll my own simple http server in Iron Python.
I have run into a road block tho - when I launch a python http server from a GH Python component both Rhino and Grasshopper cease to be responsive.
By checking the local host port from Chrome I can confirm that the server is running:
Does anyone know a way of launching a python http server from GH Python and having it running in the background? I’ve looked at Threads in Iron Python and this looks like maybe where to head, but getting ‘live’ data from the server might be an issue?
Would love your input if you have some ideas.
Cheers
DK
import SimpleHTTPServer
import SocketServer
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()