dear boss
I have reviewed my code, which I obtained from the internet; however, it did not execute properly and returned an error that I have shared for your evaluation.
Kindly provide me with the correct code for implementing a multi-level submenu in Streamlit.
‘‘‘
from hydralit import HydraApp, HydraHeadApp
import streamlit as st
class HomePage(HydraHeadApp):
def run(self):
st.title("Welcome to the Home Page")
st.write("This is the main page of the application.")
class SubMenu1Page(HydraHeadApp):
def run(self):
st.title("Sub-Menu 1 Page")
st.write("Content for the first sub-menu item.")
class SubMenu2Page(HydraHeadApp):
def run(self):
st.title("Sub-Menu 2 Page")
st.write("Content for the second sub-menu item.")
if _name_ == ‘_main_’:
app = HydraApp(title='My Multi-App', hide_streamlit_markers=True)
\# Add the main home page
app.add_app("Home", HomePage())
\# Add a main menu item with submenus
app.add_app("Main Menu", None, is_menu=True) # This creates a parent menu item
app.add_app("Sub-Menu Item 1", SubMenu1Page(), parent="Main Menu")
app.add_app("Sub-Menu Item 2", SubMenu2Page(), parent="Main Menu")
app.run()
‘‘‘
