Spaces:
Runtime error
Runtime error
prateekagrawal
commited on
Commit
•
9afe3a7
1
Parent(s):
aeb3532
Added selectbox instead of RB
Browse files- multiapp.py +7 -11
multiapp.py
CHANGED
@@ -2,21 +2,17 @@
|
|
2 |
"""
|
3 |
import streamlit as st
|
4 |
|
|
|
5 |
class MultiApp:
|
6 |
def __init__(self):
|
7 |
self.apps = []
|
8 |
|
9 |
def add_app(self, title, func):
|
10 |
-
self.apps.append({
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
-
|
16 |
-
st.sidebar.header('Navigation')
|
17 |
-
app = st.sidebar.radio(
|
18 |
-
'',
|
19 |
-
self.apps,
|
20 |
-
format_func=lambda app: app['title'])
|
21 |
|
22 |
-
app['function']()
|
2 |
"""
|
3 |
import streamlit as st
|
4 |
|
5 |
+
|
6 |
class MultiApp:
|
7 |
def __init__(self):
|
8 |
self.apps = []
|
9 |
|
10 |
def add_app(self, title, func):
|
11 |
+
self.apps.append({"title": title, "function": func})
|
12 |
+
|
13 |
+
def run(self):
|
14 |
+
# st.sidebar.header("Navigation")
|
15 |
+
app = st.sidebar.selectbox("", self.apps, format_func=lambda app: app["title"])
|
16 |
|
17 |
+
app["function"]()
|
|
|
|
|
|
|
|
|
|
|
18 |
|
|