import dash_html_components as html
import dash
from dash.dependencies import Input, Output

from multiprocessing import Value

app = dash.Dash()
app.layout = html.Div([
    html.Div(id='container'),
    html.Button('Click', id='button-1', n_clicks=0, n_clicks_previous=0),
    html.Button('Click', id='button-2', n_clicks=0, n_clicks_previous=0)
])
app.scripts.config.serve_locally = True


call_count = Value('i', 0)

@app.callback(
    Output('container', 'children'),
    [Input('button-1', 'n_clicks'),
     Input('button-1', 'n_clicks_previous'),
     Input('button-2', 'n_clicks'),
     Input('button-2', 'n_clicks_previous')])
def update_output(*args):
    print(args)
    call_count.value += 1
    print(call_count.value)
    return '{}, {}, {}, {}'.format(*args)


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