Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import MySQLdb
- from tkinter import *
- root = Tk()
- def makeLoggedInWindow():
- if(query.execute("SELECT * FROM 'USERS' where 'username'", 'username', "' AND `password`='", 'password', "'")):
- window = Tk()
- db.commit()
- label_3 = Label(window, text="Du er nu logget ind!")
- label_3.pack()
- else:
- db.commit()
- print ("Login fejlede!")
- label = Label(root, text="Velkommen til mit log ind script!")
- db = MySQLdb.connect(host="localhost",
- user="root",
- db="users")
- query = db.cursor()
- loop = 'true'
- label_1 = Label(root, text="Username: ")
- label_2 = Label(root, text="Password: ")
- username = Entry(root)
- password = Entry(root, show='*')
- button_1 = Button(root, text="Log ind!", command=makeLoggedInWindow)
- label_1.pack()
- label_2.pack()
- username.pack()
- password.pack()
- button_1.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement