Created
July 6, 2020 10:53
-
-
Save danlester/69c4d7e29fd4d06aaea1e2bf061bf575 to your computer and use it in GitHub Desktop.
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