import tkinter as tk
from tkinter import *
def Atm():
DINERO=5000
#Consultar dinero
def Consulta():
def salir():
root4.destroy()
root.deiconify()
root4 = tk.Toplevel()
root4.title(" "*20 +"Consultar")
root4.geometry("700x600")
root4.resizable(False,False)
root4.configure(background="#97BF10")
root4.iconbitmap('dinero.ico')
tk.Label(root4, text="ATM",fg='#FFFFFF',background='#000000',
font=("MV Boli", 25),height=2, width=40,justify="right").place(x=0, y=0)
tk.Label(root4, text="Tu saldo es:",fg='#FFFFFF',background='#97BF10',
font=("MV Boli", 20),height=7, width=9,justify="right").place(x=30, y=150)
resultadoN=StringVar()
resN=Entry(root4,textvariable=DINERO).place(x=220,y=265)
img = PhotoImage(file="flecha.png")
BTAA2=Button(root4,command= lambda :[salir()],text="Regresar", width=100, height=100,image=img,justify="right").place(x=570,y=470)
root4.mainloop()
#El menu para ingresar (retirar o depositar)
def Ingre():
#Retirar dinero
def Retiro():
root.iconify()
def ret():
resultadoN.set("" + str(float(resultadoN.get()) - DINERO))
messagebox.showwarning ("Finalizado"," Retiro realizado")
def limpiar():
resultadoN.set(" ")
def salir():
root2.destroy()
root.deiconify()
root2 = tk.Toplevel()
root2.title(" "*20 +"Retirar")
root2.geometry("700x600")
root2.resizable(False,False)
root2.configure(background="#97BF10")
root2.iconbitmap('tarjeta2.ico')
tk.Label(root2, text="ATM",fg='#FFFFFF',background='#000000',
font=("MV Boli", 25),height=2, width=40,justify="right").place(x=0, y=0)
tk.Label(root2, text="¿Cuanto\ndeseas\nretirar?",fg='#FFFFFF',background='#97BF10',
font=("MV Boli", 20),height=7, width=7,justify="right").place(x=30, y=150)
resultadoN=StringVar()
resN=Entry(root2,textvariable=resultadoN).place(x=220,y=265)
DTN22=Button(root2,command= lambda :[ret(),limpiar()],text="Retirar", padx=30, pady=30, background="#FFFFFF").place(x=450,y=300)
img = PhotoImage(file="flecha.png")
BTAA2=Button(root2,command= lambda :[salir()],text="Regresar", width=100, height=100,image=img,justify="right").place(x=570,y=470)
root2.mainloop()
#Depositar dinero
def Depo():
root.iconify()
def ON():
resultadoN.set("" + str(float(resultadoN.get()) + DINERO))
messagebox.showwarning ("Finalizado"," Deposito realizado")
def limpiar():
resultadoN.set(" ")
def salir():
root1.destroy()
root.deiconify()
root1 = tk.Toplevel()
root1.title(" "*20 +"Depositar")
root1.geometry("700x600")
root1.resizable(False,False)
root1.configure(background="#97BF10")
root1.iconbitmap('tarjeta1.ico')
tk.Label(root1, text="ATM",fg='#FFFFFF',background='#000000',
font=("MV Boli", 25),height=2, width=40,justify="right").place(x=0, y=0)
tk.Label(root1, text="¿Cuanto\ndeseas\ndepositar?",fg='#FFFFFF',background='#97BF10',
font=("MV Boli", 20),height=7, width=9,justify="right").place(x=30, y=150)
resultadoN=StringVar()
resN=Entry(root1,textvariable=resultadoN).place(x=220,y=265)
DTN21=Button(root1,command= lambda :[ON(),limpiar()],text="Depositar", padx=30, pady=30, background="#FFFFFF").place(x=450,y=300)
img = PhotoImage(file="flecha.png")
BTAA1=Button(root1,command= lambda :[salir()],text="Regresar", width=100, height=100,image=img,justify="right").place(x=570,y=470)
root1.mainloop()
#La ventana donde se abrira el menu de ingresar
root = tk.Toplevel()
root.title(" "*20 +"Ingresar")
root.geometry("700x600")
root.resizable(False,False)
root.configure(background="#97BF10")
root.iconbitmap('cajero.ico')
tk.Label(root, text="ATM",fg='#FFFFFF',background='#000000',
font=("MV Boli", 25),height=2, width=40,justify="right").place(x=0, y=0)
DTN2=Button(root,command= Depo, text="Depositar", padx=50, pady=60, background="#FFFFFF").place(x=450,y=200)
DTN1=Button(root,command= Retiro, text="Retirar", padx=65, pady=60, background="#FFFFFF").place(x=80,y=200)
img = PhotoImage(file="flecha.png")
BTAAP=Button(root,text="Regresar", width=100, height=100,image=img,justify="right").place(x=570,y=470)
root.mainloop()
#Ventana prncipal donde esta el meni de consultar o ingresar
rootP = tk.Toplevel()
rootP.title(" "*20 +"ATM")
rootP.geometry("700x600")
rootP.resizable(False,False)
rootP.configure(background="#97BF10")
rootP.iconbitmap('atm.ico')
tk.Label(rootP, text="Bienvenido a la ATM",fg='#FFFFFF',background='#000000',
font=("MV Boli", 25),height=2, width=40,justify="right").place(x=0, y=0)
DTN2=Button(rootP, command=Ingre, text="Ingresar", padx=50, pady=60, background="#FFFFFF").place(x=450,y=200)
DTN1=Button(rootP,command= Consulta, text="Consultar", padx=65, pady=60, background="#FFFFFF").place(x=80,y=200)
img = PhotoImage(file="casa.png")
BTAA=Button(rootP,text="Regresar", width=100, height=100,image=img,justify="right").place(x=570,y=470)
rootP.mainloop()