Hi all,
I’m learning Shiny for Python to hopefully put together some simple dashboards for data visualization drawing on netcdf archives via xarray. I do most of my analytical work in notebooks, so I’ve been using them to try to figure out Shiny as well- I know it’s not suitable for ‘finished products’, but it allows me to take notes as I go.
Anyhow, I’m missing something obvious, as the Shiny app never produces any inline output in the notebook cell.
Using a trivial example:
from shiny import App, render, ui
#UI:
app_ui = ui.page_fluid(
ui.input_slider(“n”, “Select a value”, 0, 100, 20),
ui.output_text_verbatim(“txt”),
)
#server:
def server(input, output, session):
@render.text*
def txt():
return f"The slider value is: {input.n()}"*
#make app & run
app = App(app_ui, server)
app
I’ve set the notebook in question to ‘trusted’, but the code above still only evaluates the object but does not display it. The only output is:
<shiny._app.App at “some memory address”>
Anybody have any thoughts on where I’m going wrong? This is going to be one of those things that’s really obvious in hindsight and totally baffling until then.
thanks!