gskdsrikrishna commited on
Commit
90f1bbe
Β·
verified Β·
1 Parent(s): 839506d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -1,25 +1,33 @@
1
  import streamlit as st
2
  import importlib
3
 
4
- # Define your app modules
5
  APPS = {
6
- "App 1": "app1",
7
- "App 2": "app2",
8
- "App 3": "app3",
9
- "App 4": "app4",
10
- "App 5": "app5",
11
  }
12
 
13
  # Streamlit UI
14
  st.set_page_config(page_title="Multi-App Platform", layout="wide")
15
  st.title("Multi-App Streamlit Platform")
 
16
 
17
- # Sidebar for navigation
18
- selected_app = st.sidebar.selectbox("Choose an app", list(APPS.keys()))
 
19
 
20
- # Dynamically load and run the selected app
 
 
 
 
 
 
21
  if selected_app:
22
- module_name = APPS[selected_app]
23
  try:
24
  app_module = importlib.import_module(module_name)
25
  if hasattr(app_module, "main"):
@@ -28,3 +36,7 @@ if selected_app:
28
  st.error(f"{module_name}.py must have a `main()` function.")
29
  except ModuleNotFoundError:
30
  st.error(f"Module {module_name} not found. Make sure {module_name}.py exists.")
 
 
 
 
 
1
  import streamlit as st
2
  import importlib
3
 
4
+ # Define your app modules with icons
5
  APPS = {
6
+ "App 1": {"module": "app1", "icon": "πŸ“Š"},
7
+ "App 2": {"module": "app2", "icon": "πŸ“·"},
8
+ "App 3": {"module": "app3", "icon": "🎨"},
9
+ "App 4": {"module": "app4", "icon": "πŸ“–"},
10
+ "App 5": {"module": "app5", "icon": "🎡"},
11
  }
12
 
13
  # Streamlit UI
14
  st.set_page_config(page_title="Multi-App Platform", layout="wide")
15
  st.title("Multi-App Streamlit Platform")
16
+ st.subheader("Developed by [Your Name]")
17
 
18
+ # Display apps in a grid
19
+ cols = st.columns(len(APPS))
20
+ selected_app = None
21
 
22
+ for i, (app_name, app_info) in enumerate(APPS.items()):
23
+ with cols[i]:
24
+ st.button(f"{app_info['icon']}\n{app_name}", key=app_name)
25
+ if st.session_state.get(app_name):
26
+ selected_app = app_name
27
+
28
+ # Load and run the selected app
29
  if selected_app:
30
+ module_name = APPS[selected_app]["module"]
31
  try:
32
  app_module = importlib.import_module(module_name)
33
  if hasattr(app_module, "main"):
 
36
  st.error(f"{module_name}.py must have a `main()` function.")
37
  except ModuleNotFoundError:
38
  st.error(f"Module {module_name} not found. Make sure {module_name}.py exists.")
39
+
40
+ # Footer
41
+ st.markdown("---")
42
+ st.markdown("Β© 2025 Your Name. All rights reserved.")