-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
46 lines (38 loc) · 1022 Bytes
/
main.py
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
37
38
39
40
41
42
43
44
45
46
from engine import CustomerEngine, OrderingEngine, ProductEngine
from utils import clear
def display_base_menu():
return """
1. Product
2. Customer
3. Ordering
0. Quit
"""
def sub_menu(engine, question: str):
inner = True
while inner:
clear()
engine = engine
print(engine.display_base_menu())
stdin = input(question)
clear()
inner = engine.matching(stdin)
clear()
def main():
outer = True
while outer:
print(display_base_menu())
stdin = input("Choose options (0-3): ")
match stdin:
case "1":
sub_menu(ProductEngine(), "Choose options (0-9): ")
case "2":
sub_menu(CustomerEngine(), "Choose options (0-6): ")
case "3":
sub_menu(OrderingEngine(), "Choose options (0-3): ")
case "0":
outer = False
case _:
clear()
continue
if __name__ == "__main__":
main()