Bank Management System Project in Python
Bank Management System Project in Python
Project in Python
Bank Management System project is written in Python. The
project file contains a python script (main.py) and a database
file. This is a simple console based system which is very easy
to understand and use. Talking about the system, it contains all
the basic functions which include creating a new account,
view account holders record, withdraws and deposit amount,
balance inquiry, closing an account and edit account details.
In this mini project, there is no such login system. This means
he/she can use all those available features easily without any
restriction. It is too easy to use, he/she can check the total
bank account records easily.
How To Run :
first you need install python.
download project.
extract project.
Project is run
Thanks ....
import pickle
import os
import pathlib
class Account :
accNo = 0
name = ''
deposit=0
type = ''
def createAccount(self):
self.deposit = int(input("Enter The Initial amount(>=500 for Saving and >=1000 for current"))
print("\n\n\nAccount Created")
def showAccount(self):
print("Type of Account",self.type)
print("Balance : ",self.deposit)
def modifyAccount(self):
def depositAmount(self,amount):
self.deposit += amount
def withdrawAmount(self,amount):
self.deposit -= amount
def report(self):
return self.accNo
def getAcccountHolderName(self):
return self.name
def getAccountType(self):
return self.type
def getDeposit(self):
return self.deposit
def intro():
print("\t\t\t\t**********************")
print("\t\t\t\t**********************")
print("\t\t\t\tprojectworlds.in")
input()
def writeAccount():
account = Account()
account.createAccount()
writeAccountsFile(account)
def displayAll():
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
mylist = pickle.load(infile)
infile.close()
else :
def displaySp(num):
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
mylist = pickle.load(infile)
infile.close()
found = False
if item.accNo == num :
found = True
else :
print("No records to Search")
if not found :
def depositAndWithdraw(num1,num2):
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
mylist = pickle.load(infile)
infile.close()
os.remove('accounts.data')
if item.accNo == num1 :
if num2 == 1 :
item.deposit += amount
elif num2 == 2 :
item.deposit -=amount
else :
else :
print("No records to Search")
outfile = open('newaccounts.data','wb')
pickle.dump(mylist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
def deleteAccount(num):
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
oldlist = pickle.load(infile)
infile.close()
newlist = []
if item.accNo != num :
newlist.append(item)
os.remove('accounts.data')
outfile = open('newaccounts.data','wb')
pickle.dump(newlist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
def modifyAccount(num):
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
oldlist = pickle.load(infile)
infile.close()
os.remove('accounts.data')
if item.accNo == num :
outfile = open('newaccounts.data','wb')
pickle.dump(oldlist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
def writeAccountsFile(account) :
file = pathlib.Path("accounts.data")
if file.exists ():
infile = open('accounts.data','rb')
oldlist = pickle.load(infile)
oldlist.append(account)
infile.close()
os.remove('accounts.data')
else :
oldlist = [account]
outfile = open('newaccounts.data','wb')
pickle.dump(oldlist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
ch=''
num=0
intro()
while ch != 8:
#system("cls");
print("\tMAIN MENU")
print("\t8. EXIT")
print("\tSelect Your Option (1-8) ")
ch = input()
#system("cls");
if ch == '1':
writeAccount()
elif ch =='2':
depositAndWithdraw(num, 1)
elif ch == '3':
depositAndWithdraw(num, 2)
elif ch == '4':
displaySp(num)
elif ch == '5':
displayAll();
elif ch == '6':
deleteAccount(num)
elif ch == '7':
modifyAccount(num)
elif ch == '8':
else :
print("Invalid choice")