Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def register():
- username = input("Please input your desired usernamen")
- password = input("Please input your desired passwordn")
- file = open("accountfile.txt", "a")
- file.write(username)
- file.write(" ")
- file.write(str(password))
- file.write("n")
- file.close()
- if login():
- print("You are now logged in...")
- else:
- print("You aren't logged in!")
- def login():
- username = input("Please enter your usernamen")
- password = input("Please enter your passwordn")
- for line in open("accountfile.txt", "r").readlines():
- login_info = line.split()
- if username == login_info[0] and password == login_info[1]:
- print("Correct credentials!")
- return True
- print("Incorrect credentials.")
- return False
Add Comment
Please, Sign In to add comment