Guest User

Untitled

a guest
Apr 19th, 2017
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # Validation of the login as well as outputting a message to user
  2. def Is_Valid():
  3. UsernameValidity=UserName_Entry.get()
  4. PasswordValidity=Password_Entry.get()
  5. cursor.execute('''SELECT password FROM users WHERE username = ?''', (UsernameValidity,))
  6. cursor.execute('''SELECT username FROM users WHERE password = ?''', (PasswordValidity,))
  7. LogInAttempt = cursor.fetchone()
  8. print (Is_Valid) # Testing to see if it works on shell
  9. if LogInAttempt:
  10. print (" One of the accounts have successfully logged in ")
  11. IsValidText.config(text=" You have logged in! ", fg="black", highlightthickness=1)
  12. else:
  13. print (" One of the accounts inputted the wrong credentials! ")
  14. IsValidText.config(text=" Invalid username or Password! ", fg="black", highlightthickness=1)
Add Comment
Please, Sign In to add comment