gskdsrikrishna commited on
Commit
1562cbd
Β·
verified Β·
1 Parent(s): 065d2d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -25
app.py CHANGED
@@ -1,46 +1,42 @@
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 2x3 grid
19
  cols = st.columns(3)
20
  selected_app = None
21
 
22
- app_items = list(APPS.items())
23
- for i in range(0, len(app_items), 3):
24
- row_apps = app_items[i:i+3]
25
- row = st.columns(3)
26
- for col, (app_name, app_info) in zip(row, row_apps):
27
- with col:
28
- st.image("placeholder.png", width=100) # Replace with actual logo path
29
- if st.button(f"{app_info['icon']}\n{app_name}", key=app_name):
30
- selected_app = app_name
31
 
32
  # Load and run the selected app
33
  if selected_app:
34
- module_name = APPS[selected_app]["module"]
35
  try:
36
- app_module = importlib.import_module(module_name)
37
  if hasattr(app_module, "main"):
38
  app_module.main()
39
  else:
40
- st.error(f"{module_name}.py must have a `main()` function.")
41
  except ModuleNotFoundError:
42
- st.error(f"Module {module_name} not found. Make sure {module_name}.py exists.")
43
 
44
  # Footer
45
  st.markdown("---")
46
- st.markdown("Β© 2025 Your Name. All rights reserved.")
 
1
  import streamlit as st
2
  import importlib
3
 
4
+ # Define your app modules with icons and images
5
+ APPS = [
6
+ {"name": "Chat", "module": "chatgskd", "image": "chatgskd.png"},
7
+ {"name": "Google", "module": "google", "image": "google.png"},
8
+ {"name": "Wikipedia", "module": "wikipedia", "image": "wikipedia.png"},
9
+ {"name": "News", "module": "news", "image": "news.png"},
10
+ {"name": "YouTube", "module": "youtube", "image": "youtube.png"},
11
+ ]
12
 
13
  # Streamlit UI
14
+ st.set_page_config(page_title="Multimodal Query Processing & Knowledge Retrieval System", layout="wide")
15
+ st.title("MMQPKRS")
16
+ st.subheader("Developed by Gskd")
17
 
18
  # Display apps in a 2x3 grid
19
  cols = st.columns(3)
20
  selected_app = None
21
 
22
+ for i, app in enumerate(APPS):
23
+ col = cols[i % 3]
24
+ with col:
25
+ st.image(app["image"], width=100)
26
+ if st.button(app["name"], key=app["name"]):
27
+ selected_app = app["module"]
 
 
 
28
 
29
  # Load and run the selected app
30
  if selected_app:
 
31
  try:
32
+ app_module = importlib.import_module(selected_app)
33
  if hasattr(app_module, "main"):
34
  app_module.main()
35
  else:
36
+ st.error(f"{selected_app}.py must have a `main()` function.")
37
  except ModuleNotFoundError:
38
+ st.error(f"Module {selected_app} not found. Make sure {selected_app}.py exists.")
39
 
40
  # Footer
41
  st.markdown("---")
42
+ st.markdown("Β© 2025 Gskd and our team members. All rights reserved.")