Spaces:
Running
Running
File size: 810 Bytes
7405474 791e079 f4ff78b 791e079 f4ff78b 791e079 f4ff78b 791e079 f702b43 41216ee f17fb79 791e079 6dd2090 791e079 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import streamlit as st
import importlib.util
# Define the paths to the other apps
FIRST_APP_PATH = "app-memora.py"
SECOND_APP_PATH = "app-news-content.py"
def run_script(script_path):
"""
Dynamically load and execute a Python script's main() function.
"""
# Load the module from the script path
spec = importlib.util.spec_from_file_location("module.name", script_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
def main():
st.sidebar.title("Navigation")
app_choice = st.sidebar.radio("Choose an App:", ["Memora", "Dynamic News Summarizer"])
if app_choice == "Memora":
run_script(FIRST_APP_PATH)
elif app_choice == "Dynamic News Summarizer":
run_script(SECOND_APP_PATH)
if __name__ == "__main__":
main()
|