stroke-prediction / multiapp.py
bhvsh's picture
Add application files
4b4425b
raw
history blame
515 Bytes
"""Frameworks for running multiple Streamlit applications as a single app.
"""
import streamlit as st
class MultiApp:
def __init__(self):
self.apps = []
def add_app(self, title, func):
self.apps.append({
"title": title,
"function": func
})
def run(self):
app = st.selectbox(
'Navigation',
self.apps,
format_func=lambda app: app['title'])
return app
def view(self, app):
app['function']()