雷几把,五个文件别把你小脑搞混了。
1,main
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("请输入您的操作:\n")
if option not in ("1", "2", "3", "4", "5",
"6", "7", "Q", "q"):
print("输入操作项有误,请仔细确认!")
time.sleep(1)
# ********** Begin **********
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()
# ********** End