<reponame>PacktPublishing/Python-Interactive-Dashboards-with-Plotly-Dash<filename>code/building_callbacks_with_single_input_output.py<gh_stars>1-10
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output

app = dash.Dash()

app.layout = html.Div([
    dcc.Input(id='input-text', value='Change this text', type='text'),
    html.Div(children='', id='output-text')
                       ])


@app.callback(
    Output(component_id='output-text', component_property='children'),
    Input(component_id='input-text', component_property='value')
)
def update_output_div(input_text):
    return f'Text: {input_text}'


if __name__ == '__main__':
    app.run_server(debug=True)
