Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login():
- print("LOGIN SCREEN")
- #open the file we are reading from
- with open("file.txt",'r') as file:
- #prompt the user to enter their login details
- username=input("Enter username")
- password=input("Enter password")
- #call upon our reader (this allows us to work with our file)
- fileReader=csv.reader(file)
- #for each row that is read by the Reader
- for row in fileReader:
- #print(row[0]) - this would print the first field in the row (the username)
- #print(row[1]) - this would print the second field in the row (the password)
- #search for the required matches in user entry against what is stored in the file
- if username==row[0] and password==row[1]:
- print("access granted")
- else:
- print("denied")
- menu()
- JoeBloggs1979,Open@123,Joe,Bloggs,10/01/1979,144 CWRoad,CR30AX,Female,Thriller,joey@hotmail.com
- PigacheeMoose2016,Carrots@123,pigachee,moose,12/05/2016,Picachh Drive,CR3 CCC,Female,PIgness,mmf@hotmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement