roberta-testing / multiapp.py
prateekagrawal's picture
Initial commit
6554f2c
raw history blame
No virus
513 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):
st.sidebar.header('Navigation')
app = st.sidebar.radio(
'',
self.apps,
format_func=lambda app: app['title'])
app['function']()