Spaces:
Runtime error
Runtime error
Update appStore/multiapp.py
Browse files- appStore/multiapp.py +3 -17
appStore/multiapp.py
CHANGED
|
@@ -8,23 +8,8 @@ if 'file' not in st.session_state:
|
|
| 8 |
st.session_state['file'] = None
|
| 9 |
|
| 10 |
class MultiApp:
|
| 11 |
-
"""
|
| 12 |
-
|
| 13 |
-
def foo():
|
| 14 |
-
st.title("Hello Foo")
|
| 15 |
-
def bar():
|
| 16 |
-
st.title("Hello Bar")
|
| 17 |
-
app = MultiApp()
|
| 18 |
-
app.add_app("Foo", foo)
|
| 19 |
-
app.add_app("Bar", bar)
|
| 20 |
-
app.run()
|
| 21 |
-
It is also possible keep each application in a separate file.
|
| 22 |
-
import foo
|
| 23 |
-
import bar
|
| 24 |
-
app = MultiApp()
|
| 25 |
-
app.add_app("Foo", foo.app)
|
| 26 |
-
app.add_app("Bar", bar.app)
|
| 27 |
-
app.run()
|
| 28 |
"""
|
| 29 |
def __init__(self):
|
| 30 |
self.apps = []
|
|
@@ -56,6 +41,7 @@ class MultiApp:
|
|
| 56 |
self.apps,
|
| 57 |
format_func=lambda app: app['title'])
|
| 58 |
app['function']()
|
|
|
|
| 59 |
st.sidebar.markdown("## ๐ Step One: Upload document ")
|
| 60 |
file = st.sidebar.file_uploader('', type=['pdf', 'docx', 'txt']) #Upload PDF File
|
| 61 |
st.session_state['file'] = file
|
|
|
|
| 8 |
st.session_state['file'] = None
|
| 9 |
|
| 10 |
class MultiApp:
|
| 11 |
+
"""
|
| 12 |
+
Framework for combining multiple streamlit applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"""
|
| 14 |
def __init__(self):
|
| 15 |
self.apps = []
|
|
|
|
| 41 |
self.apps,
|
| 42 |
format_func=lambda app: app['title'])
|
| 43 |
app['function']()
|
| 44 |
+
st.sidebar.markdown('')
|
| 45 |
st.sidebar.markdown("## ๐ Step One: Upload document ")
|
| 46 |
file = st.sidebar.file_uploader('', type=['pdf', 'docx', 'txt']) #Upload PDF File
|
| 47 |
st.session_state['file'] = file
|