Advertisement
Guest User

code

a guest
Apr 24th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import MySQLdb
  2. from tkinter import *
  3.  
  4. root = Tk()
  5.  
  6. def makeLoggedInWindow():
  7. if(query.execute("SELECT * FROM 'USERS' where 'username'", 'username', "' AND `password`='", 'password', "'")):
  8. window = Tk()
  9. db.commit()
  10. label_3 = Label(window, text="Du er nu logget ind!")
  11. label_3.pack()
  12. else:
  13. db.commit()
  14. print ("Login fejlede!")
  15.  
  16. label = Label(root, text="Velkommen til mit log ind script!")
  17. db = MySQLdb.connect(host="localhost",
  18. user="root",
  19. db="users")
  20.  
  21. query = db.cursor()
  22.  
  23. loop = 'true'
  24. label_1 = Label(root, text="Username: ")
  25. label_2 = Label(root, text="Password: ")
  26. username = Entry(root)
  27. password = Entry(root, show='*')
  28. button_1 = Button(root, text="Log ind!", command=makeLoggedInWindow)
  29.  
  30. label_1.pack()
  31. label_2.pack()
  32. username.pack()
  33. password.pack()
  34. button_1.pack()
  35.  
  36. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement