CoolFace
Apppublic

iFiveZero/SimpleDashApp

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
app.py33 linesDownload Raw Back to root
1from dash import Dash, dcc, html, Input, Output, callback2 3app = Dash(__name__)4 5app.layout = html.Div([6    #Heading7    html.H1("Change the value in the text box to see callbacks in action!"),8    # Input Section9    html.Div([10        "Input: ",11        dcc.Input(id='my-input', value='test value', type='text')12    ]),13    # Section break14    html.Br(),15    #Output value16    html.Div(id='my-output'),17 18])19 20 21@callback(22    Output(component_id='my-output', component_property='children'),23    Input(component_id='my-input', component_property='value')24)25#this is the input function26def update_output_test(nomatter):27    return f'Output: {nomatter}'28 29 30if __name__ == '__main__':31    #Update host and port to match dockerfile32    app.run(debug=True, host='0.0.0.0', port=7860)33