Build Physical Structure of ATM Using Python Tkinter

Hello coders we create this project with Tkinter  and SQL Datebase.

  •   In this project we create a Physical Structure of ATM in which we add our data directly in database and we can edit or delete the data directly from database.
  • We also create automatic Withdraw Money in this project after adding  the data.
  • We create search data option in various forms.

Libraries used-

>>Tkinter(for GUI)

>>pymysql(for database)

>>smtlib(for email)

>>Datetime(for date-filling)

Step to create GUI-

  • Install Tkinter using pip install
  • Import Tkinter
  • Create the main window
  • Define the number of widgets

Step to connect Database-

  • Install MySql and install pymysql using pip
  • Create database and tables in SQL
  • Connect the Database in python code

Algorithm-

  • Define: Four Frames and Label of title
  • Frame1: Create Labels and Entry boxes of student Information
  • Frame2: Create buttons ADD,UPDATE,DELETE,CLEAR
  • Frame3: Create Label, Combo-box, Buttons and Entry
  • Frame4: Create Frame labels,column-entry and Scrollbars
  • Define Functions for the buttons
  • Use datetime library to fill date automatic in entry boxes
  • Add commands to the buttons

Source code-

from tkinter import*
import sqlite3
from tkinter import messagebox
conn=sqlite3.connect('atmdb.db')
Input= ""
pin=""
#==========================================================================Function Block==============================================================================
def wc():
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit(): 
        try:
            amt=int(e1.get())
            if amt>0:
                try:
                    conn.execute("update atm set balance = balance - ? where pin = ?",(amt,pin))
                    conn.commit()
                    acc_list=[]
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            m = '''{}, RS.{} Withdrawal Successfully'''.format(i[0],amt)
                            messagebox.showinfo("Money Withdrawal !", m)
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            acc_list.append("{}".format(i[0]))
                            text='''{}, RS.{} Withdrawal Successfully'''.format(i[0],amt)
                            L2=Label(f3,text=text,font="arial")
                            L2.grid(row =2,column=0)
                except:
                    conn.rollback()
            else:
                messagebox.showwarning("warning","Invalid Amount Try again")
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("") 
    def call_back():
        withdraw()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("CURRENT")
    ob.geometry("1600x800")
    ob.configure(background="black")

    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Please use the number pad to enter the amount you wish to withdraw",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)


    
    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=368,y=200,height=100,width=630)
    
    l1=Label(f1,text="Amount",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter Amount')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)


def ws():
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            
            amt=int(e1.get())
            if amt>0:
                try:
                    conn.execute("update atm set balance = balance - ? where pin = ?",(amt,pin))
                    conn.commit()
                    acc_list=[]
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                                m = '''{}, RS.{} Withdrawal Successfully'''.format(i[0],amt)
                                messagebox.showinfo("Money Withdrawal !", m)
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            acc_list.append("{}".format(i[0]))
                            text='''{}, RS.{} Withdrawal Successfully'''.format(i[0],amt)
                            L2=Label(f3,text=text,font="arial")
                            L2.grid(row =2,column=0)
                except:
                    conn.rollback()
            else:
                messagebox.showwarning("warning","Invalid Amount Try again")
                
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("") 
    def call_back():
        withdraw()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("SAVINGS")
    ob.geometry("1600x800")
    ob.configure(background="black")
    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Please use the number pad to enter the amount you wish to withdraw",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)


    
    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=lambda:clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=368,y=200,height=100,width=630)
    
    l1=Label(f1,text="Amount",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter Amount')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)

def withdraw():
    def call_wc():
        p=False
        global pin
        ac_type='CURRENT'
        for i in conn.execute("select ac_type from atm where pin=?",(pin,)):
            if i[0]==ac_type:
                p=True
                wc()
                ob.destroy()
            else:
                pass
        if not p:
                messagebox.showinfo("imformation",'''Dear User !
you do not have Current Account''')
    def call_ws():
        p=False
        global pin
        ac_type='SAVING'
        for i in conn.execute("select ac_type from atm where pin=?",(pin,)):
            if i[0]==ac_type:
                p=True
                ws()
                ob.destroy()
            else:
                pass
        if not p:
                messagebox.showinfo("imformation",'''Dear User !
you do not have Saving Account''')
    def call_back():
        ep()
        ob.destroy()
        
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
                messagebox.showinfo("information","Thanks for using Our ATM Service")
                ob.destroy()
        else:
                pass         
    ob= Tk()
    ob.title("Withdrowl")
    ob.geometry("1600x800")
    ob.configure(background="black")

    f2=Frame(ob,height=800,width=400,relief="raise")
    f2.pack(side=TOP)

    l1=Label(f2,text="Please touch an option on the screen to select the account type from which you wish to withdraw cash",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)
    
    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.pack(side=RIGHT)
    b1=Button(f1,text="Current",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=65,bd=10,command=call_wc)
    b1.grid(row=1,column=0)
    l1=Label(f1,text="      ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=100,bd=10)
    l1.grid(row=2,column=0)
    b2=Button(f1,text="Savings",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=62,bd=10,command=call_ws)
    b2.grid(row=3,column=0)
    b3=Button(f1,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=83,bd=10,command=call_back)
    b3.grid(row=0,column=0)
    b4=Button(f1,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=70,bd=10,command=cancel)
    b4.grid(row=4,column=0)
    
def be():
    def bes():
        actype=False
        global pin
        ac_type='SAVING'
        acc_list=[]
        for i in conn.execute("select name,balance,pin from atm where ac_type = ?",(ac_type,)):
            if i[2]==pin:
                actype=True
                m='''{},
Your Saving Account Balance is {}'''.format(i[0],i[1])
                messagebox.showinfo("Savings Account Balance",m)
        for i in conn.execute("select name,balance,pin from atm where ac_type = ?",(ac_type,)):
            if i[2]==pin:
                actype=True
                acc_list.append("{}".format(i[0]))
                acc_list.append("{}".format(i[1]))
                text=acc_list[0]+",Your Saving Account Balance is "+acc_list[1]
                L1=Label(f2,text=text,font="arial")
                L1.grid(row =0,column=0)
                
        if not actype:
            messagebox.showinfo("Balance Enquiry","Sorry ! You do not have Saving Account")
        
    def bec():
        actype=False
        global pin
        ac_type='CURRENT'
        acc_list=[]
        for i in conn.execute("select name,balance,pin from atm where ac_type = ?",(ac_type,)):
            if i[2]==pin:
                actype=True
                m='''{},
Your Current Account Balance is {}'''.format(i[0],i[1])
                messagebox.showinfo("Current Account Balance",m)
        for i in conn.execute("select name,balance,pin from atm where ac_type = ?",(ac_type,)):
            if i[2]==pin:
                actype=True
                acc_list.append("{}".format(i[0]))
                acc_list.append("{}".format(i[1]))
                text=acc_list[0]+",Your Current Account Balance is "+acc_list[1]
                L1=Label(f2,text=text,font="arial")
                L1.grid(row =0,column=0)
        
        if not actype:
            messagebox.showinfo("Balance Enquiry","Sorry ! You do not have Current Account")
        
        
    def call_back():
        ep()
        ob.destroy()
        
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")

    f2=Frame(ob,bd=8,relief="raise")
    f2.pack(side=LEFT)
                
    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.pack(side=RIGHT)
    b1=Button(f1,text="Current",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=65,bd=10,command=bec)
    b1.grid(row=1,column=0)
    l1=Label(f1,text="      ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=100,bd=10)
    l1.grid(row=2,column=0)
    b2=Button(f1,text="Savings",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=62,bd=10,command=bes)
    b2.grid(row=3,column=0)
    b3=Button(f1,text="  Back ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=69,bd=10,command=call_back)
    b3.grid(row=0,column=0)
    b4=Button(f1,text=" Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=67,bd=10,command=cancel)
    b4.grid(row=4,column=0)

    



def pcs():
    
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            global pin
            npin=int(e1.get())
            if npin>=1000 and npin<=9999:
                try:
                    conn.execute("update atm set pin = ? where pin = ?",(npin,pin))
                    conn.commit()
                    pin=npin
                    messagebox.showinfo("imformation",'''Dear User !
        Your PIN Updated Successfully''')
                    ep()
                    ob.destroy()
                except:
                    conn.rollback()
            else:
                messagebox.showwarning("imformation","Invalid PIN")
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("") 
    def call_back():
        pc()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")

    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Enter new PIN",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)

    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=368,y=200,height=100,width=630)

    l1=Label(f1,text="New PIN",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter New PIN')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)


    

def pc():
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            global pin
            p=False
            cpin=int(e1.get())
            if cpin>=1000 and cpin<=9999:
                for i in conn.execute("select pin from atm where pin=?",(pin,)):
                    if i[0]==cpin:
                        p=True
                        pcs()
                        ob.destroy()
                    else:
                        pass
                if not p:
                    messagebox.showwarning("imformation","You Entered Wrong PIN")
            else:
                messagebox.showwarning("imformation","Invalid PIN")
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("")
            
    def call_back():
        ep()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")

    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Enter your current PIN",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)
    
    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=362,y=200,height=100,width=668)
    
    l1=Label(f1,text="Current PIN",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter Current PIN')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)

def dc():
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            amt=int(e1.get())
            if amt>0:
                try:
                    conn.execute("update atm set balance = balance + ? where pin = ?",(amt,pin))
                    conn.commit()
                    acc_list=[]
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            m = '''{}, RS.{} Deposite Successfully'''.format(i[0],amt)
                            messagebox.showinfo("Money Deposite !", m)
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            acc_list.append("{}".format(i[0]))
                            text='''{}, RS.{} Deposite Successfully'''.format(i[0],amt)
                            L2=Label(f3,text=text,font="arial")
                            L2.grid(row =2,column=0)
                except:
                    conn.rollback()
            else:
                messagebox.showwarning("warning","Invalid Amount Try again")
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("") 
    def call_back():
        deposite()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("CURRENT")
    ob.geometry("1600x800")
    ob.configure(background="black")

    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Please use the number pad to enter the amount you wish to Deposite",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)


    
    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=368,y=200,height=100,width=630)
    
    l1=Label(f1,text="Amount",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter Amount')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2) 

def ds():
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            
            amt=int(e1.get())
            if amt>0:
                try:
                    conn.execute("update atm set balance = balance + ? where pin = ?",(amt,pin))
                    conn.commit()
                    acc_list=[]
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                                m = '''{}, RS.{} Deposited Successfully'''.format(i[0],amt)
                                messagebox.showinfo("Money Deposite !", m)
                    for i in conn.execute("select name,balance,pin from atm where pin = ?",(pin,)):
                        if i[2]==pin:
                            acc_list.append("{}".format(i[0]))
                            text='''{}, RS.{} Deposited Successfully'''.format(i[0],amt)
                            L2=Label(f3,text=text,font="arial")
                            L2.grid(row =2,column=0)
                except:
                    conn.rollback()
            else:
                messagebox.showwarning("warning","Invalid Amount Try again")
                
        except:
            data.set(" error ")
            Input=""

    def clear(): 
            global Input 
            Input = "" 
            data.set("") 
    def call_back():
        deposite()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("SAVINGS")
    ob.geometry("1600x800")
    ob.configure(background="black")
    data=StringVar()

    f3=Frame(ob,height=800,width=400,relief="raise")
    f3.pack(side=TOP)

    l1=Label(f3,text="Please use the number pad to enter the amount you wish to Deposite",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)


    
    f2=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)
    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=lambda:clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=23,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=22,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=33,bd=10,command=call_back)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.place(x=368,y=200,height=100,width=630)
    
    l1=Label(f1,text="Amount",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter Amount')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)

def deposite():
    def call_dc():
        p=False
        global pin
        ac_type='CURRENT'
        for i in conn.execute("select ac_type from atm where pin=?",(pin,)):
            if i[0]==ac_type:
                p=True
                dc()
                ob.destroy()
            else:
                pass
        if not p:
                messagebox.showinfo("imformation",'''Dear User !
you do not have Current Account''')
    def call_ds():
        p=False
        global pin
        ac_type='SAVING'
        for i in conn.execute("select ac_type from atm where pin=?",(pin,)):
            if i[0]==ac_type:
                p=True
                ds()
                ob.destroy()
            else:
                pass
        if not p:
                messagebox.showinfo("imformation",'''Dear User !
you do not have Saving Account''')
    def call_back():
        ep()
        ob.destroy()
        
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
                messagebox.showinfo("information","Thanks for using Our ATM Service")
                ob.destroy()
        else:
                pass         
    ob= Tk()
    ob.title("Withdrowl")
    ob.geometry("1600x800")
    ob.configure(background="black")

    f2=Frame(ob,height=800,width=400,relief="raise")
    f2.pack(side=TOP)

    l1=Label(f2,text="Please touch an option on the screen to select the account type from which you wish to withdraw cash",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)
    
    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.pack(side=RIGHT)
    b1=Button(f1,text="Current",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=65,bd=10,command=call_dc)
    b1.grid(row=1,column=0)
    l1=Label(f1,text="      ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=100,bd=10)
    l1.grid(row=2,column=0)
    b2=Button(f1,text="Savings",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=62,bd=10,command=call_ds)
    b2.grid(row=3,column=0)
    b3=Button(f1,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=83,bd=10,command=call_back)
    b3.grid(row=0,column=0)
    b4=Button(f1,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=70,bd=10,command=cancel)
    b4.grid(row=4,column=0)
    
'''def ms():
    def call_back():
        ep()
        ob.destroy()
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")

    f2=Frame(ob,height=800,width=400,relief="raise")
    f2.pack(side=TOP)

    l1=Label(f2,text="Mini statement would be provided only for the Primary account linked to your card",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)

    
    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.pack(side=RIGHT)
    b1=Button(f1,text="Yes",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=25,bd=10)
    b1.grid(row=1,column=0)
    l1=Label(f1,text="       ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=30,pady=15,bd=10)
    l1.grid(row=2,column=0)
    b2=Button(f1,text="No ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=24,bd=10)
    b2.grid(row=3,column=0)
    b3=Button(f1,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=15,bd=10,command=call_back)
    b3.grid(row=0,column=0)
    b4=Button(f1,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),bd=10,command=cancel)
    b4.grid(row=4,column=0)'''

def ep():
    def call_be():
        be()
        ob.destroy()
        
    def call_pc():
        pc()
        ob.destroy()
        
    '''def call_ms():
        ms()
        ob.destroy()'''

    def call_deposite():
        deposite()
        ob.destroy()
        
    def call_withdraw():
        withdraw()
        ob.destroy()
        
    def call_back():
        start()
        ob.destroy()

    def call_acdetails():
        #fetchdetails()
        acc_list=[]
        for i in conn.execute("select name,ac_no,ac_type,p_no,email,age,gender,balance from atm where pin = ?",(pin,)):
            acc_list.append("Name:  {}".format(i[0]))
            acc_list.append("Account no.: {}".format(i[1]))
            acc_list.append("Account type: {}".format(i[2]))
            acc_list.append("Phone NO.: {}".format(i[3]))
            acc_list.append("E-Mail: {}".format(i[4]))
            acc_list.append("Age: {}".format(i[5]))
            acc_list.append("Gender: {}".format(i[6]))
            acc_list.append("Balance: {}".format(i[7]))
        for i in conn.execute("select name,ac_no,ac_type,p_no,email,age,gender,balance from atm where pin = ?",(pin,)):
            m='''Name:  {}
Account no.: {}
Account type: {}
Phone NO.: {}
E-Mail: {}
Age: {}
Gender: {}
Balance: {}'''.format(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7])
        messagebox.showinfo("Account Details",m)

        text = acc_list[0]+"\n"+acc_list[1]+"\n"+acc_list[2]+"\n"+acc_list[3]+"\n"+acc_list[4]+"\n"+acc_list[5]+"\n"+acc_list[6]+"\n"+acc_list[7]
        label = Label(f3,text=text,font="arial")
        label.grid(row=0,column=0)
        
        
        
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")
    
    f3=Frame(ob,bd=8,relief="raise")
    f3.pack(side=LEFT)

    f2=Frame(ob,height=800,width=400,relief="raise")
    f2.pack(side=TOP)

    l1=Label(f2,text="Please touch an option on the screen to make a selection",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)
    

    f1=Frame(ob,height=800,width=400,bd=8,relief="raise")
    f1.pack(side=RIGHT)

    b1=Button(f1,text="Withdraw",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=68,bd=10,command=call_withdraw)
    b1.grid(row=1,column=0)
    b2=Button(f1,text="Balance Enquiry",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=call_be)
    b2.grid(row=2,column=0)
    b3=Button(f1,text="Pin Change",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=52,bd=10,command=call_pc)
    b3.grid(row=3,column=0)
    b4=Button(f1,text="Deposite",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=70,bd=10,command=call_deposite)
    b4.grid(row=4,column=0)
    b5=Button(f1,text="Back",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=95,bd=10,command=call_back)
    b5.grid(row=5,column=0)
    b6=Button(f1,text="cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=85,bd=10,command=cancel)
    b6.grid(row=6,column=0)
    b7=Button(f1,text="Account Details",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=25,bd=10,command=call_acdetails)
    b7.grid(row=0,column=0)


    
#======================================================================================================================================================================
def start():
    
    def onclick(num): 
            global Input 
            Input = Input + str(num) 
            data.set(Input)
    def submit():
        try:
            p=False
            t=int(e1.get())
            if t>=1000 and t<=9999: 
                temp = conn.execute("select name,pin,ac_no,ac_type,balance from atm where pin = ? ", (t,))
                for i in temp:
                    p = i[1]
                    global pin
                    pin=p
                    if p==t:
                        p = True
                        m = '''Login SucessFull !
Welcome ! {},'''.format(i[0])
                        #self.database_fetch()
                        messagebox.showinfo("Login Info", m)
                        #self.frame.destroy()
                        ep()
                        ob.destroy()
                    else:
                        p = True
                        m = " Login UnSucessFull ! Wrong PIN"
                        messagebox.showinfo("Login Info!", m)

                if not p:
                    m = " Wrong PIN Number !"
                    messagebox.showwarning("Login Info!", m)
            else:
                messagebox.showwarning("warning","Invalid PIN Try again")
        except:
            data.set(" error ")
            Input=""
            
    def clear(): 
            global Input 
            Input = "" 
            data.set("")
    def cancel():
        response=messagebox.askquestion("Confirm","Are you sure?")
        if response=="yes":
            messagebox.showinfo("information","Thanks for using Our ATM Service")
            ob.destroy()
        else:
            pass
    ob= Tk()
    ob.title("GUI")
    ob.geometry("1600x800")
    ob.configure(background="black")
    conn = sqlite3.connect('atmdb.db') 
    data = StringVar()
    
    f3=Frame(ob,height=400,width=400,relief="raise")
    f3.pack(side=TOP)


    l1=Label(f3,text="Hello,Please use the number pad to enter your Personal Identification Number(PIN)",bg="black",fg="powder blue",font=("ariel",20,"bold"))
    l1.grid(row=0,column=0)


    f2=Frame(ob,height=400,width=400,bd=5,relief="raise")
    f2.place(x=450,y=300,height=300,width=470)


    b1=Button(f2,text="1",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(1))
    b1.grid(row=0,column=0)
    b2=Button(f2,text="2",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(2))
    b2.grid(row=0,column=1)
    b3=Button(f2,text="3",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(3))
    b3.grid(row=0,column=2)
    b4=Button(f2,text=" Clear ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=clear)
    b4.grid(row=0,column=3)
    b5=Button(f2,text="4",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(4))
    b5.grid(row=1,column=0)
    b6=Button(f2,text="5",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(5))
    b6.grid(row=1,column=1)
    b7=Button(f2,text="6",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(6))
    b7.grid(row=1,column=2)
    b8=Button(f2,text=" Enter ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b8.grid(row=1,column=3)
    b9=Button(f2,text="7",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(7))
    b9.grid(row=2,column=0)
    b10=Button(f2,text="8",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(8))
    b10.grid(row=2,column=1)
    b11=Button(f2,text="9",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(9))
    b11.grid(row=2,column=2)
    b12=Button(f2,text="Cancel",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=cancel)
    b12.grid(row=2,column=3)
    b13=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b13.grid(row=3,column=0)
    b14=Button(f2,text="0",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=lambda:onclick(0))
    b14.grid(row=3,column=1)
    b15=Button(f2,text="  ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b15.grid(row=3,column=2)
    b16=Button(f2,text="           ",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10)
    b16.grid(row=3,column=3)

    f1=Frame(ob,height=800,width=400,bd=5,relief="raise")
    f1.place(x=402,y=200,height=100,width=556)
        
    l1=Label(f1,text="PIN",bg="black",fg="powder blue",font=("ariel",20,"bold"),pady=10,bd=10)
    l1.grid(row=0,column=0)
    e1=Entry(f1,bg="black",fg="powder blue",font=("ariel",20,"bold"),textvariable=data)
    e1.grid(row=0,column=1)
    data.set('Enter your PIN')
    b1=Button(f1,text="Submit",bg="black",fg="powder blue",font=("ariel",20,"bold"),padx=20,bd=10,command=submit)
    b1.grid(row=0,column=2)

start()

OUTPUT-

Step1: Easy to Enter Your Pin Number with Security.

Step 2: After Login .Check Your Acount Details, Withdraw money if you want, Check your Balance Enquiry, PIN Change etc.

Step 3: After that you can withaw money to enter Amount

Here if you have any doubt feel free to connect us +91-7982108418

Write a comment