-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
36 lines (35 loc) · 1.14 KB
/
menu.py
File metadata and controls
36 lines (35 loc) · 1.14 KB
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
30
31
32
33
34
35
36
from admin_dash import AdminDash
from cus_dash import CustDash
import os
from colorama import init
from colorama import Fore, Back, Style
from time import sleep
init()
class InvalidChoiceOnMainMenu(Exception):
pass
os.system('cls')
print(Fore.MAGENTA + Back.LIGHTWHITE_EX + Style.BRIGHT)
print()
os.system('cls')
print('\n\n\n\n\n\n\n\n\n\t\t\t\t***************WELCOME********************')
sleep(0.5)
os.system('cls')
print("\n\n\n\n\n\t\t\t\t\t********************Main Menu********************\n\n\n")
while True:
try:
op = int(input("\t\t\t1.Admin\t\t\t2.Customer\n\n\t\t\tChoose Login Type : "))
os.system('cls')
if not((op == 1) or (op == 2)):
raise InvalidChoiceOnMainMenu
else:
if op == 1:
obj = AdminDash()
print(Style.RESET_ALL + "END OF PROGRAM")
break
elif op == 2:
obj = CustDash()
print(Style.RESET_ALL + "END OF PROGRAM")
break
except InvalidChoiceOnMainMenu as e:
print("Entered an invalid choice !")
print(e, "\nTry Again !")