This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
from dash.dependencies import Input, Output | |
import dash_html_components as html | |
from datetime import datetime | |
app = dash.Dash(__name__) | |
start_time = datetime.now() | |
app.layout = html.Div(children=[ | |
html.H1(children='Start time {}'.format(start_time)), | |
html.Div(children='', id='outputdiv'), | |
html.Button('Increment', id='button', n_clicks=0) | |
]) | |
@app.callback(Output('outputdiv', 'children'), [Input('button', 'n_clicks')]) | |
def add_sliders(n_clicks): | |
return 'Clicked! Start Time {}; Count {}'.format(start_time, n_clicks) | |
if __name__ == '__main__': | |
app.run_server(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment