Advertisement
PastebinNexus

Menu system for python

Dec 23rd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. def callmenumain(): #This will be a way to call upon the main menu from any submenu that uses "callmainmenu()"
  2.     print("""#Lets show the user the options
  3. ====Menu====
  4. 1]Submenu 1
  5. 2]Submenu 2
  6. 3]Submenu 3
  7. ============""")
  8.     selectinput=input("Select an input number from the menu:\n")
  9.     if selectinput=="1":
  10.             callsubmenu1()#Defined somewhere else in the code
  11.     elif selectinput=="2":
  12.             callsubmenu2()#Defined somewhere else in the code
  13.     elif selectinput=="3":
  14.             callsubmenu3()#Defined somewhere else in the code
  15. callmainmenu()#At the very end of the code, put this so the code will run through the menu system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement