Skip to content

Instantly share code, notes, and snippets.

@tashrifbillah
Created July 1, 2020 21:28
Show Gist options
  • Save tashrifbillah/f94c10b2b0f6a37270fefad6370b5035 to your computer and use it in GitHub Desktop.
Save tashrifbillah/f94c10b2b0f6a37270fefad6370b5035 to your computer and use it in GitHub Desktop.
Minimal dash app for testing PID
#!/usr/bin/env python
import base64, io
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from dash_table import DataTable
from dash.exceptions import PreventUpdate
import plotly.graph_objects as go
from os.path import isfile, isdir, abspath, join as pjoin, dirname
from os import makedirs
from subprocess import check_call
import pandas as pd
import numpy as np
import os
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True)
app.layout= html.Div([
html.H1('Input'),
html.Div(id='page-content'),
dcc.Input(id='var1'),
])
@app.callback(Output('page-content','children'),
[Input('var1','value')])
def dummy(value):
print(value)
return str(os.getpid())
if __name__=='__main__':
app.run_server(debug=True, port=8050, host='localhost')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment