Hello all, I am still needing some help on this code, I have gone a bit
further on it. Thank you for the help. I am trying to understand how to
make the file searchable and how I am to make the deposit and withdrawl
interact with the transaction class.
I need to just search the file only for the deposits and withdrawls and
the amount in the account with a time stamp. Thank you for your
assistance.
class Account:
def __init__(self, initial):
self.balance = initial
def deposit(self, amt):
self.balance = self.balance + amt
def withdraw(self, amt):
self.balance = self.balance - amt
def getbalance(self ):
return self.balance
class Transactoin:
def transaction(sel f,
self.transactio n =
import time
time.asctime()
raw_input("Is this a deposit or withdrawl?")
if withdrawl:
elif
raw_input("Plea se enter amount here.")
class Deposit(Transac tion):
def deposit(self, amt):
self.balance = self.balance + amt
def getbalance(self ):
return self.balance
class Withdrawl(Trasa ction):
def withdrawl(self, amt):
self.balance = self.balance - amt
def getbalance(self ):
return self.balance
import pickle
pickle.dump ((withdrawl), file ('account.pickl e', 'w'))
pickle.dump ((deposit), file ('account.pickl e', 'w'))
print "Your current account total is.", self.balance
further on it. Thank you for the help. I am trying to understand how to
make the file searchable and how I am to make the deposit and withdrawl
interact with the transaction class.
I need to just search the file only for the deposits and withdrawls and
the amount in the account with a time stamp. Thank you for your
assistance.
class Account:
def __init__(self, initial):
self.balance = initial
def deposit(self, amt):
self.balance = self.balance + amt
def withdraw(self, amt):
self.balance = self.balance - amt
def getbalance(self ):
return self.balance
class Transactoin:
def transaction(sel f,
self.transactio n =
import time
time.asctime()
raw_input("Is this a deposit or withdrawl?")
if withdrawl:
elif
raw_input("Plea se enter amount here.")
class Deposit(Transac tion):
def deposit(self, amt):
self.balance = self.balance + amt
def getbalance(self ):
return self.balance
class Withdrawl(Trasa ction):
def withdrawl(self, amt):
self.balance = self.balance - amt
def getbalance(self ):
return self.balance
import pickle
pickle.dump ((withdrawl), file ('account.pickl e', 'w'))
pickle.dump ((deposit), file ('account.pickl e', 'w'))
print "Your current account total is.", self.balance
Comment