コード例 #1
0
#for cleared balance: get the list of the history of cleared balance calculations
objFile = open("ClearedBalanceRecord.dat", "rb")
ClearedBalLst = pickle.load(objFile)
ClearedBal = ClearedBalLst[-1][0]  #this is the most recent cleared balance
objFile.close()

#for transaction record, get stored data:
LstTrans = StoreData.RetrieveTransLst()

#Each separate transaction is a list.  Balance is the last item in the list.
#  The last item of the last transaction in LstTrans is the final balance.
Balance = LstTrans[-1][-1]

print("Welcome to the checking account register\n")
print("Ending balance:", Balance)
print("Today's balance:", Searches.GetTodaysBalance(LstTrans))
print("Cleared balance:", ClearedBal)
print("Last unique ID:", intUniqueId)
#Print the last 10 transactions on opening the script:
print(
    "\nLast 10 transactions--------------------------------------------------")
LstRecentTrans = LstTrans[-10:]
Presentation.PrintRegister(LstRecentTrans)

#----------------I/O-------------------------------------------------------

while True:
    print("""
    MENU of options:
    Enter a debit......................w
    Enter a deposit....................d