Although it would be much more helpful if you showed us your code, an easy solution to your problem is to have an HTML.div in the layout and set it with an id, and with the corresponding ID, create a callback with the ID as the output that returns the value of the variable.
An example:
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
app = dash.Dash(__name__)
app.layout = html.Div([
html.Div(id='my-output'),
html.Div(id='my-output'),
])
x = "hi"
@app.callback(
Output(component_id='my-output', component_property='children'),
Input(component_id='my-input', component_property='children')
)
def update_output_div(input):
return x
if __name__ == '__main__':
app.run_server(debug=True)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…