I'm creating dashboards with PyPanel in VScode with Python and I've noticed that occasionally, especially since finalising a HTML and .exe dashboard, the output code (i.e the prints and displays) within the VS code (when I try to run the base code itself for debugging) does not show. I have no idea why as it's only started happening a lot within the last week and it's getting to the point where my coding efficiency has dropped tremendously (I have to run the dashboard before outputs appear in the base code.
Here is a sample code with a dashboard below where the outputs are not shown in my VS Code interface. I have tried restarting kernels and the program and nothing has solved it (Note that my dashboard coding is 1000s of lines of code but I have simplified it a lot to the code above for convenience, ease and simplicity):
import panel as pn
import param
from panel.interact import interact
pn.extension()
Example_text = pn.widgets.TextInput(value='Example', width=280, disabled=True)
Layout_example = pn.GridBox(Example_text)
display(Layout_example)
print('Example Text')
#Layout using Template
template = pn.template.VanillaTemplate(
title='Example Dashboard',
sidebar=[pn.pane.Markdown("# Example Dashboard"),
# pn.pane.Markdown("#### Example Dashboard."),
pn.pane.Markdown("## Example Dashboard"),
pn.pane.Markdown('''**Example Dashboard** <br><br>''')],
main=[Layout_example],
#background_color ="#ffffff", #grey
#neutral_color = "#ffffff", #white #Panel
#accent_base_color="#000000", #black
header_background= "#16537e" # nav blue"#DAA520", #gold
)
template.show()
#template.servable();
The dashboard loads fine, and in the main VScode the usual output produced is:
However a lot of the time I get no output in my code unless I first load the dashboard and go from there. Why?
Use a function call such as Layout_example.show()
for manual outputting when this error occurs.