Dynamically create bokeh serve - directory format

I have a single script which can dynamically create a Bokeh Server.

Is there a similar way of dynamically launching if the Bokeh Server is in directory format? (Explained here):

This is a simplified version of my current method of dynamically creating a script. (I need it to be able to launch as an .exe).

from bokeh.layouts import column
from bokeh.models import Button
from bokeh.plotting import figure, curdoc
from bokeh.server.server import Server

def standalone(doc):

    b1 = Button(label='b1')
    b2 = Button(label='b2', visible=False)

    def switcharoo():
        if b1.visible == True:
            b1.visible = False
            b2.visible = True
            b1.visible = True
            b2.visible = False

    # put the button and plot in a layout and add to the document
    doc.add_root(column(b1, b2))

server = Server({'/': standalone}, num_procs=1)

server.io_loop.add_callback(server.show, "/")