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.
if you are using Linux based OS then open terminal and type
ps -ef
Search for the bokeh application file running in the process and note down the PID i.e. Process ID, suppose process ID id 3366 then using command
kill 3366
kill the process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With