ATM MACHINE
ATM MACHINE
ATM MACHINE
FRONT END : PYTHON
DATABASE REQUIREMENT
import mysql.connector
conn=mysql.connector.connect(host='localhost',user='root',password='root')
if conn.is_connected():
print("sucessfully connected")
c1=conn.cursor()
c1.execute(mn)
print("Sucessfulluy created")
conn=mysql.connector.connect(host='localhost',user='root',password='root',database='ATM_MA
CHINE')
c1=conn.cursor()
c1.execute(sql)
print("="*60)
print("="*60)
print("2.To login")
print("3.Exit")
print("="*60)
print("="*60)
if op==1:
c="y"
while c=="y":
c1.execute(cb)
d=c1.fetchall()
data=c1.rowcount
if data==1:
print("="*60)
print("="*60)
if c=="y":
continue
else:
print("Visit again")
print("=================================================================
===============")
else:
print("=================================================================
===============")
c1.execute(ab)
conn.commit()
print("=================================================================
===============")
print("=================================================================
===============")
sr="update records set CR_AMT={} where ACCONT_NO={}".format(s,m)
c1.execute(sr)
conn.commit()
c1.execute(ef)
conn.commit()
print("sucessfully deposited")
print("Visit again")
break
if op==2:
y="y"
while y=="y":
c1.execute(cb)
c1.fetchall()
data=c1.rowcount
if data==1:
print("=================================================================
===============")
c1.execute(e)
a=c1.fetchone()
d=list(a)
if pas==d[0]:
print("correct")
print("1.Depositng money")
print("2.withdrawing money")
print("3.Transfering money")
print("4.Checking balance")
print("=================================================================
===============")
print("=================================================================
===============")
if r==1:
print("=================================================================
===============")
c1.execute(sr)
conn.commit()
c1.execute(ef)
conn.commit()
print("sucessfully deposited")
print("=================================================================
===============")
if t=="y":
continue
else:
if r==2:
print("=================================================================
===============")
c1.execute(ah)
m=c1.fetchone()
if amt >m[0]:
print("=================================================================
===============")
else:
sr="update records set balance=balance - {} where
ACCONT_NO={}".format(amt,acct)
c1.execute(ed)
c1.execute(sr)
conn.commit()
print("Sucessfully updatad")
if y=="y":
continue
else:
if r==3:
print("=================================================================
===============")
c1.execute(cb)
c1.fetchall()
data=c1.rowcount
if data==1:
c1.execute(ah)
c=c1.fetchone()
if m > c[0]:
print("=================================================================
===============")
else:
c1.execute(av)
c1.execute(cv)
c1.execute(w)
c1.execute(t)
conn.commit()
print("Sucessfully transfered")
continue
else:
if r==4:
c1.execute(ma)
k=c1.fetchone()
print("=================================================================
===============")
if y=="y":
continue
else:
if r==5:
c1.execute(cb)
c1.fetchall()
data=c1.rowcount
if data==1:
print("Try again")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
else:
c1.execute(ar)
conn.commit()
else:
print("Wrong password")
print("=================================================================
===============")
else:
print("Exiting")
c1.close()