Advertisement
Guest User

Untitled

a guest
Jan 10th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. #Login GUI
  4. window = Tk()
  5. window.title("Countries Generation")
  6. window.geometry("400x300")
  7. window.configure(bg="#cccccc")
  8.  
  9. username = "admin"
  10. password = "secret"
  11.  
  12. def callback():
  13. if (usertitle == username) and (passtitle == password):
  14. message.configure(text = "Valid Logged in.")
  15. else:
  16. message.configure(text = "Username and password don't match. \nPlease try again.")
  17.  
  18. title1 = Label(window, text="Log in", bg="#6491ca")
  19. usertitle = Label(window, text="---Username---", bg="#6491ca")
  20. passtitle = Label(window, text="---Password---", bg="#6491ca")
  21. message = Label(window, bg="#6491ca")
  22.  
  23. user = Entry(window)
  24. passw = Entry(window, show='*')
  25.  
  26. go = Button(window, text="Log in!", command = callback, bg="#3e3365")
  27.  
  28. title1.pack()
  29. usertitle.pack()
  30. user.pack()
  31. passtitle.pack()
  32. passw.pack()
  33. go.pack()
  34. message.pack()
  35.  
  36. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement