Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login():
- while True:
- username = input("Please enter your username ")
- password = input("Please enter your password ")
- with sqlite3.connect("Timetable.db") as db:
- cursor = db.cursor()
- find_user = ("SELECT * FROM students WHERE username = ? AND password = ?")
- cursor.execute(find_user,[(username),(password)])
- results = cursor.fetchall()
- if results:
- print("Welcome")
- break
- else:
- print("Username and password wrong ")
- again = input("try again? (y/n): ")
- if again.lower() == "n":
- print("bye")
- time.sleep(1)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement