I have a script that I want to run with bokeh serve
to display and evaluate results, but I also want to be able to run the same script without bokeh. There's some internal logic that depends on which mode it's running, so I need to be able tot test if the script is launched with bokeh serve
or without.
I tried evaluating curdoc()
, assuming that when run without bokeh serve
it would return None
, but in both cases it returns some object, so I can't simply do an if curdoc()
.
So far I didn't find any reference to this kind of test in the bokeh docs.