Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Bokeh serve application using PyCharm

Tags:

python

bokeh

Bokeh serve allows to write fast web apps with plots and widgets. How can I debug the python code when I use bokeh serve --show code.py?

like image 664
Hanan Shteingart Avatar asked Jan 10 '17 13:01

Hanan Shteingart


People also ask

Can I Debug in PyCharm?

In PyCharm Professional Edition you can also debug code you're running inside a Docker container, within a VM, or on a remote host through SSH.

How do I enable Debug mode in PyCharm?

Just right-click any line in the editor and select the Debug <filename> command from the context menu. After the program has been suspended, use the debugger to get the information about the state of the program and how it changes during running.


1 Answers

I found that you start the process in a process that already has the debugger attached to it, the debugger would be added there as well.

For example you can run the code below to do so

bokeh_process = subprocess.Popen(
['python', '-m', 'bokeh', 'serve', 'bokeh_server.py'], stdout=subprocess.PIPE)
like image 123
Alexander Wolf Avatar answered Nov 10 '22 18:11

Alexander Wolf