cardel

Ejemplo 2 GP10

Jun 15th, 2021
616
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import *
  2. from tkinter import messagebox
  3.  
  4.  
  5. def Ok():
  6.     nombre = entrada1.get()
  7.     password = entrada2.get()
  8.  
  9.     if(nombre == "" and password == "") :
  10.         messagebox.showinfo("", "Blank Not allowed")
  11.  
  12.  
  13.     elif(nombre == "Admin" and password == "123"):
  14.  
  15.         messagebox.showinfo("","Login Success")
  16.         ventana.destroy()
  17.  
  18.     else :
  19.         messagebox.showinfo("","Incorrent Username and Password")
  20.  
  21.  
  22. ventana = Tk()
  23. ventana.title("formulario de entrada")
  24. ventana.geometry("300x200")
  25. ventana.configure(bg='blue')
  26.  
  27. Label(ventana, text="Usuario").place(x=10, y=10)
  28. Label(ventana, text="Clave").place(x=10, y=40)
  29.  
  30. entrada1 = Entry(ventana)
  31. entrada1.place(x=140, y=10)
  32.  
  33. entrada2 = Entry(ventana)
  34. entrada2.place(x=140, y=40)
  35. entrada2.config(show="*")
  36.  
  37. Button(ventana, text="entrar", command=Ok ,height = 2, width = 13).place(x=30, y=100)
  38.  
  39. ventana.mainloop()
  40.  
RAW Paste Data