def serve_dtool_directory ( directory , port ) : os . chdir ( directory ) server_address = ( "localhost" , port ) httpd = DtoolHTTPServer ( server_address , DtoolHTTPRequestHandler ) httpd . serve_forever ( )
use python to server a directory over http
Serve the datasets in a directory over HTTP .
def serve_dtool_directory(directory, port):
    """Serve the datasets in a directory over HTTP."""
    os.chdir(directory)
    server_address = ("localhost", port)
    httpd = DtoolHTTPServer(server_address, DtoolHTTPRequestHandler)
    httpd.serve_forever()