import streamlit as st | |
import subprocess | |
def run_prediction(): | |
result = subprocess.run(['python', 'prediction.py'], stdout=subprocess.PIPE) | |
return result.stdout.decode('utf-8') | |
def run_eda(): | |
result = subprocess.run(['python', 'eda.py'], stdout=subprocess.PIPE) | |
return result.stdout.decode('utf-8') | |
pages = { | |
'Prediction': run_prediction, | |
'EDA': run_eda, | |
} | |
selected_page = st.sidebar.selectbox('Select a page', list(pages.keys())) | |
page_content = pages[selected_page]() | |
st.write(page_content) |