Establishing Real Time Bokeh Plot That Intakes Variables From Other source

I’m trying to establish a simple function that intakes a few variables and will display the function on the server and update in real time accordingly. Most of the trouble stems from calling the server itself as the bokeh plot refuses to show unless I manually type in “bokeh serve --show” This is a problem as I need the program to autonomously set up the socket since I will be accessing the function from an external application, such as MATLAB.
Here is the Main Function with the Bokeh Plot Instruction:

import os
from import output_file,show
from bokeh.driving import count
from bokeh.models import ColumnDataSource, HoverTool
from bokeh.plotting import curdoc, figure
from bokeh.client import push_session
import math
import time

def sinusoid(a,b,c,d):
source = ColumnDataSource({“x”: , “y”: })
sinPlot = figure(x_range=(1,10),plot_width=450)
sinPlot.line(“x”, “y”, source=source)

    def update(t):
        t =(time.time()-t0)*3
        test={'x':[t], 'y':[a*math.sin(b*t+c)+d]}

    doc = curdoc()

    print("Function runs :) !")


This is how I intend to access this base function from either another python program or MATLAB through the pylib:

import rtt
import os
os.system(‘cmd /k “cd C:\Users\zmaty\AppData\Local\Programs\Python\Python37\DLLs && bokeh serve --show”’)

However, the web page is opened but is completely blank, thus my implementation must be wrong.
Is there a different way to implement this Bokeh Server so that either the Main Function is able to set up the server itself or have it running for any other application to call the function Sinusoid and load it directly?

What calls the sinusoid function? The bottom line is commented out, so running bokeh serve --show will open a blank page, as you observe.

Regarding alternative ways of using Bokeh server - here’s the relevant documentation section:

The plan is to run a separate program to input variables, such as


just not sure where to call the serve --show in return

Ah, I think I see. You recursively call the same file via a subprocess.
Don’t do that, it’s incredibly hard to reason about and to do right. Just embed Bokeh as a library as described in the link I provided.