I do use bokeh to plot sensor data live on the local LAN. Bokeh is started from within my python application using popen:
Popen("bokeh serve --host=localhost:5006 --host=192.168.8.100:5006", shell=True)
bokeh serve --help
self.bokeh_serve = subprocess.Popen(shlex.split(command),
Without knowing bokeh and assuming that you use Python >= 3.2 or Linux, you could try to kill the process with
Popen.pid or even better
Popen.send_signal(). If bokeh has proper signal handlers, it will even shutdown cleanly.
However, you may be better off using the option
shell=False, because with
shell=True, the signal is sent to the shell instead of the actual process.