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 AddNewCard(self): NewCard = Card() Bank.AccAndCardsAssoc[NewCard.CardNo] = self.AccNo 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()