Force to open a new browser window with standalone bokeh server

I want to run python and hope it opens a new browser window no matter whether a browser is already open or not. How to achieve this? Thanks!

Minium working example:

from bokeh.server.server import Server
from bokeh.models import TextInput

def make_document(doc):
    status_text = TextInput(title='', value='Ready', disabled=True,
    doc.add_root(status_text, sizing_mode='stretch_width')

apps = {'/': make_document}
server = Server(apps)
server.io_loop.add_callback(, "/")

Per the documentation you could try passing new="window" to open a new window every time (e.g. use functools.partial or lambda to bake in the different param value and pass the wrapper to add_callback).

However, please be advised that is really just a very thin wrapper on top of the Python stdlib function. That function has a lot of platform-dependent, 'if possible", caveats. There is no guarantee that that what you ask for is possible on all platforms, or on the platform you happen to be using. YMMV and you will just have to try and see.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.