Untitled
3 years ago in Plain Text
def password_database():
"""Reading data from the database."""
password_data = 'SELECT account_number, password FROM users;'
cursor.execute(password_data)
results = cursor.fetchall()
for row in results:
print(row)
#return row
def login(access):
"""Validation of the login and password."""
print('\n' + '-' * 34 + ' LOGIN ' + '-' * 33)
z = '\nUser number: '
name = get_operation_number(z)
x = 'Password: '
password = get_password(x)
if name == access[0] and password == access[1]:
print(colored('Login successful!', 'blue'))
menu(id)
else:
print(colored('Wrong login or password.', 'red'))
login(access)
access = password_database()
login(access)