def UpdateAcc(self, Field, FieldType): if FieldType == 'Name': Account.UpdateName(self, Name) elif FieldType == 'Mobile': Account.UpdateMobileNo(self, MobileNo) Bank.SaveFile() Bank.LoadFile()
def SaveFile(): Account.SaveFile() Card.SaveFile() file = "LC22_HW1_BankClass.txt" f = open(file, "wb") pickle.dump(Bank.AccAndCardsAssoc, f) f.close()
def LoadFile(): Account.LoadFile() Card.LoadFile() file = "LC22_HW1_BankClass.txt" f = open(file, "rb") Bank.AccAndCardsAssoc = pickle.load(f) f.close()
def Withdraw(self, amount): Account.Withdraw(self, amount) Bank.SaveFile() Bank.LoadFile()
def Deposit(self, amount): Account.Deposit(self, amount) Bank.SaveFile() Bank.LoadFile()
def AddAccount(self, Name, Bal, MobileNo, AadharNo): NewAcc = Account(Name, Bal, MobileNo, AadharNo) NewCard = Card() Bank.AccAndCardsAssoc[NewCard.CardNo] = NewAcc.AccNo Bank.SaveFile() Bank.LoadFile()