Can anyone give an example how I can get the index I selected from the submenu. It can be print out after it is back to the top menu.
Here is the code for the menu. Many thanks!
from consolemenu import
from consolemenu.items import
def action(name):
pass
def main():
# Create the root menu
menu = ConsoleMenu("Root Menu", "This is the Root Menu Subtitle")
submenu = SelectionMenu(["item1", "item2", "item3"], title="Selection Menu",
subtitle="These menu items return to the previous menu") # Customize the exit text
submenu_item = SubmenuItem("Submenu item", submenu=submenu)
#selection_item = SelectionItem("Selection Item", submenu)
#submenu_item.set_menu(submenu)
# Add all the items to the root menu
menu.append_item(submenu_item)
# Show the menu
menu.start()
menu.join()
Hi there! I like this console-menu project.
Can anyone give an example how I can get the index I selected from the submenu. It can be print out after it is back to the top menu.
Here is the code for the menu. Many thanks!
from consolemenu import from consolemenu.items import
def action(name): pass
def main():
if name == "main": main()