Online Bank Management
Online Bank Management
Online Bank Management
Introduction:
The code you provided represents a basic online bank management system
implemented using Python and MySQL. This system allows users to perform various
banking operations, including opening new accounts, depositing and withdrawing
money, checking account balances, displaying customer details, and closing
accounts.
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",password="Vineeth@1
23",database="BANK_MANAGEMENT")
def OpenAcc():
n=input("Enter The Name:")
add=input("Enter Address:")
data1=(n,ac,db,add,cn,ob)
data2=(n,ac,ob)
x=mydb.cursor()
x.execute(sql1,data1)
x.execute(sql2,data2)
mydb.commit()
main()
def DepoAmo():
data=(ac,)
x=mydb.cursor()
x.execute(a,data)
result=x.fetchone()
t=result[-1]+amount
d=(t,ac)
x.execute(sql1,d)
mydb.commit()
main()
def withdrawAmount():
data=(ac,)
x=mydb.cursor()
x.execute(a,data)
result=x.fetchone()
t=result[-1]-amount
d=(t,ac)
x.execute(sql1,d)
mydb.commit()
main()
def balEnq():
data=(ac,)
x=mydb.cursor()
x.execute(a,data)
result=x.fetchone()
main()
def DisDetails():
data=(ac,)
x=mydb.cursor()
x.execute(a,data)
result=x.fetchone()
for i in result:
print(i)
main()
def closeAcc():
data=(ac,)
x=mydb.cursor()
x.execute(sql1,data)
x.execute(sql2,data)
mydb.commit()
main()
def main():
print('''
2.Deposit Amount
3.Withdraw
4.Balance Enquiry
6.Close An Account
''')
OpenAcc()
elif(choice=="2"):
DepoAmo()
elif(choice=="3"):
withdrawAmount()
elif(choice=="4"):
balEnq()
elif(choice=="5"):
DisDetails()
elif(choice=="6"):
closeAcc()
else:
main()
main()