From 3791b6a76f43261d6f30ff9bd7d61a1da90617f0 Mon Sep 17 00:00:00 2001 From: pmbx5c4sj <1423888965@qq.com> Date: Wed, 29 May 2024 17:22:48 +0800 Subject: [PATCH] ADD file via upload --- 银行系统.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 银行系统.py diff --git a/银行系统.py b/银行系统.py new file mode 100644 index 0000000..8a314f4 --- /dev/null +++ b/银行系统.py @@ -0,0 +1,43 @@ +from admin import Admin +from atm import ATM +import time +class HomePage: + def __init__(self): + self.allUserD = {} # 使用字典存储数据 + self.atm = ATM(self.allUserD) + self.admin = Admin() # 管理员开机界面 + def saveUser(self): + self.allUserD.update(self.atm.alluser) + print("数据存盘成功") + def main(self): + self.admin.printAdminView() + resL = self.admin.adminOption() + if not resL: + while True: + self.admin.printsysFunctionView() + option = input("请输入您的操作:") + if option not in ("1", "2", "3", "4", "5", "6", "7", "S", "Q"): + print("输入操作项有误,请仔细确认!") + time.sleep(1) + if option == "1": # 开户 + self.atm.creatUser() + elif option == "2": # 查询 + self.atm.searchUser() + elif option == "3": # 取款 + self.atm.getMoney() + elif option == "4": # 存储 + self.atm.saveMoney() + elif option == "5": # 转账 + self.atm.transferMoney() + elif option == "6": # 锁定 + self.atm.lockCard() + elif option == "7": # 解锁 + self.atm.unlockCard() + elif option.upper() == "8": + if not (self.admin.adminOption()): + self.saveUser() + print('退出系统') + return -1 +if __name__ == "__main__": + homepage = HomePage() + homepage.main()