-
Notifications
You must be signed in to change notification settings - Fork 7
/
userpass.py
37 lines (33 loc) · 1013 Bytes
/
userpass.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
32
33
34
35
36
37
import csv
def main():
with open("users.txt","r") as file:
file_reader = csv.reader(file)
user_find(file_reader)
file.close()
def user_find(file):
while True:
user = input("Enter your username: ")
try:
for row in file:
if row[0] == user:
print("username found", user)
user_found = [row[0],row[1]]
pass_check(user_found)
else:
print("not found")
except:
print('Processing error')
def pass_check(user_found):
while True:
user = input("enter your password: ")
try:
if user_found[1] == user:
print("password match")
print('Logged in.')
break
else:
print("password not match")
user_find(file_reader)
except:
print('Processing error')
main()