Skip to content

Instantly share code, notes, and snippets.

@amichuda
amichuda / app.py
Created March 27, 2020 02:53 — forked from kylrth/app.py
Debugging Bokeh server applications using Visual Studio Code
import ptvsd
# attach to VS Code debugger if this script was run with BOKEH_VS_DEBUG=true
if os.environ['BOKEH_VS_DEBUG'] == 'true':
# 5678 is the default attach port in the VS Code debug configurations
print('Waiting for debugger attach')
ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)
ptvsd.wait_for_attach()
@amichuda
amichuda / app.py
Created March 27, 2020 02:53 — forked from kylrth/app.py
Debugging Bokeh server applications using Visual Studio Code
import ptvsd
# attach to VS Code debugger if this script was run with BOKEH_VS_DEBUG=true
if os.environ['BOKEH_VS_DEBUG'] == 'true':
# 5678 is the default attach port in the VS Code debug configurations
print('Waiting for debugger attach')
ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)
ptvsd.wait_for_attach()