-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (34 loc) · 1.03 KB
/
main.py
File metadata and controls
44 lines (34 loc) · 1.03 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
37
38
39
40
41
42
43
44
from admin.admin import Admin
from atm.atm import ATMMachine
from bank.operations import BankOperations
from common.constants import (EXIT_MSG, INVALID_CHOICE, MAIN_MENU)
def main():
"""
Run the main menu loop for admin, bank, and ATM operations.
"""
admin = Admin()
bank_ops = BankOperations()
atm_machine = ATMMachine()
while True:
choice = input(MAIN_MENU).strip()
if choice == "1":
if admin.admin_login():
admin.admin_menu()
elif choice == "2":
if bank_ops.bank_login():
bank_ops.bank_menu()
elif choice == "3":
atm = atm_machine.select_atm()
if not atm:
continue
user = atm_machine.authenticate()
if not user:
continue
atm_machine.transaction_menu(user, atm)
elif choice == "0":
print(EXIT_MSG)
break
else:
print(INVALID_CHOICE)
if __name__ == "__main__":
main()