SHARE
TWEET

Untitled

a guest Oct 18th, 2019 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def login():
  2.     while True:
  3.         username = input("Please enter your username ")
  4.         password = input("Please enter your password ")
  5.         with sqlite3.connect("Timetable.db") as db:
  6.             cursor = db.cursor()
  7.         find_user = ("SELECT * FROM students WHERE username = ? AND password = ?")
  8.         cursor.execute(find_user,[(username),(password)])
  9.         results = cursor.fetchall()
  10.         if results:
  11.             print("Welcome")
  12.             break
  13.         else:
  14.             print("Username and password wrong ")
  15.             again = input("try again? (y/n):  ")
  16.             if again.lower() == "n":
  17.                 print("bye")
  18.                 time.sleep(1)
  19.                 break
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top