Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. class Application(Frame):
  4. def __init__(self,master):
  5. super(Application, self).__init__(master)#Set __init__ to the master class
  6. self.grid()
  7. self.create_main()#Creates function
  8.  
  9. def create_main(self):
  10. print("testing")
  11. self.title = Label(self, text=" Stuck In The Circle ")#TITLE
  12. self.title.grid(row=0, column=2)
  13.  
  14. self.user_entry_label = Label(self, text="Username: ")#USERNAME LABEL
  15. self.user_entry_label.grid(row=1, column=1)
  16.  
  17. self.user_entry = Entry(self) #USERNAME ENTRY BOX
  18. self.user_entry.grid(row=1, column=2)
  19.  
  20. self.pass_entry_label = Label(self, text="Password: ")#PASSWORD LABEL
  21. self.pass_entry_label.grid(row=2, column=1)
  22.  
  23. self.pass_entry = Entry(self) #PASSWORD ENTRY BOX
  24. self.pass_entry.grid(row=2, column=2)
  25.  
  26. self.sign_in_butt = Button(self, text="Sign In",command = self.logging_in)#SIGN IN BUTTON
  27. self.sign_in_butt.grid(row=5, column=2)
  28.  
  29. def logging_in(self):
  30. print("hi")
  31. user_get = user_entry.get()#Retrieve Username
  32. pass_get = pass_entry.get()#Retrieve Password
  33.  
  34. if user_get == 'sam':
  35. if pass_get == '123':
  36. print("Welcome!")
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. #Main
  44. root = Tk()
  45. root.title("Stuck in the Circle")
  46. root.geometry("400x100")
  47.  
  48. app = Application(root)#The frame is inside the widgit
  49. root.mainloop()#Keeps the window open/running
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement