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)
I would like to close bokeh server from within the application. However, I cannot find anything in the documentation. Also bokeh serve --help
does not give any hint how to do that.
EDIT: based on the accepted answer I came up with following solution:
self.bokeh_serve = subprocess.Popen(shlex.split(command),
shell=False, stdout=subprocess.PIPE)
I used self.bokeh_serve.kill()
for ending the process. Maybe .terminate()
would be better. I will try it.