I am trying to print text onto a dash app as if in a console so I have assigned an id for html.P() and printing on to it. initially, it runs good for some time but later it gives these errors.
call back error when only using this as a multipage dash app.
here are pics of errors shown on console and verbose respectively
connection timeout error
this is the code I tried I don’t know if I am doing it right so any different approaches are welcomed.
import datetime
import sqlite3
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
import dash
import dash_bootstrap_components as dbc
external_stylesheets = [dbc.themes.BOOTSTRAP, 'https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, suppress_callback_exceptions=True, external_stylesheets=external_stylesheets)
latest_sno = 0
app.layout = html.Div([
html.Div([
dcc.Interval(id="interval", interval=0.1* 1000, n_intervals=0),
html.P(id="content"),
])
])
@app.callback(
Output("content", "children"),
Input("interval", "n_intervals"),
State("content", "children"),
)
def update_output(interval, content):
if not content:
return ['']
current_time = datetime.datetime.now().strftime('%H:%M:%S')
current_time = [current_time] + [html.Br()]
return content + current_time
if __name__ == "__main__":
app.run_server(debug=True)