-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.py
33 lines (19 loc) · 836 Bytes
/
login.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sqlite3
class LogIn():
def __init__(self):
self.create_Connect()
def create_Connect(self):
self.connect=sqlite3.connect("Database.db")
self.cursor=self.connect.cursor()
def logIn(self,username,password):
self.cursor.execute("Select kullaniciAdi,sifre From UserData where (kullaniciAdi=? or email=?) and sifre=?",(username,username,password))
user_data=self.cursor.fetchall()
if username and password:
if len(user_data)==0:
return "Yanlış Kullanıcı Adı veya Şifre, lütfen bilgilerinizi tekrar kontrol edin."
else:
return f"Hoşgeldiniz, {username}"
else:
return "Eksik bilgi!, lütfen bilgilerinizi tekrar kontrol edin."
def __del__(self):
self.connect.close()