Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # NEA TASK TWO - 5669
- # Imports
- import time
- import sys
- # Definations
- def newPage():
- for i in range(999):
- print()
- # User Options Menu
- print("""
- __ __ _ _ _ __ ___
- | \/ | (_) (_) | | /_ | / _ \
- | \ / |_ _ ___ _ ___ _ __ _| | __ _| || | | |
- | |\/| | | | / __| |/ __| |/ _` | | \ \ / / || | | |
- | | | | |_| \__ \ | (__| | (_| | | \ V /| || |_| |
- |_| |_|\__,_|___/_|\___|_|\__,_|_| \_/ |_(_)___/
- a program by josh meyer
- """)
- print()
- print("A: Sign Up ")
- print("B: Login ")
- optionOf = input("Please Enter a Letter: ").upper() # .upper() ensures whatever they input will be in uppercase.
- # Signing Up
- if optionOf == "A":
- print("You are now signing up..")
- newPage()
- userName = input("Username: ")
- userData = open("userData.txt","r")
- for loop in range (9):
- readData = userData.readline()
- splitData = readData.split(",")
- if splitData[0] == userName:
- print("This username is being used already.")
- else:
- userData = open("userData.txt","a+")
- passWord = input("Password: ")
- userData.write(userName + str(",") + passWord + str("\n")) # Prints Data to File
- time.sleep(0.8)
- userData.close()
- print("Congratulations, You are now logged in as,",userName + str("!"))
- if optionOf == "B":
- print("You are now singing up...")
- newPage()
- userName = input("Username: ")
- userData = open("userData.txt","r")
- for loop in range (9):
- readData = userData.readline()
- splitData = readData.split(",")
- if splitData[0] == userName:
- print("We found your account!")
- passWord = input("Password: ")
- if splitData[1] == passWord:
- print("Account Found, You are now logged in,",userName,str("."))
- else:
- print("Invalid Credentials")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement