Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. # NEA TASK TWO - 5669
  2.  
  3. # Imports
  4. import time
  5. import sys
  6.  
  7. # Definations
  8. def newPage():
  9. for i in range(999):
  10. print()
  11.  
  12. # User Options Menu
  13.  
  14.  
  15. print("""
  16. __ __ _ _ _ __ ___
  17. | \/ | (_) (_) | | /_ | / _ \
  18. | \ / |_ _ ___ _ ___ _ __ _| | __ _| || | | |
  19. | |\/| | | | / __| |/ __| |/ _` | | \ \ / / || | | |
  20. | | | | |_| \__ \ | (__| | (_| | | \ V /| || |_| |
  21. |_| |_|\__,_|___/_|\___|_|\__,_|_| \_/ |_(_)___/
  22. a program by josh meyer
  23. """)
  24. print()
  25. print("A: Sign Up ")
  26. print("B: Login ")
  27. optionOf = input("Please Enter a Letter: ").upper() # .upper() ensures whatever they input will be in uppercase.
  28.  
  29. # Signing Up
  30. if optionOf == "A":
  31. print("You are now signing up..")
  32. newPage()
  33. userName = input("Username: ")
  34. userData = open("userData.txt","r")
  35. for loop in range (9):
  36. readData = userData.readline()
  37. splitData = readData.split(",")
  38. if splitData[0] == userName:
  39. print("This username is being used already.")
  40. else:
  41. userData = open("userData.txt","a+")
  42. passWord = input("Password: ")
  43. userData.write(userName + str(",") + passWord + str("\n")) # Prints Data to File
  44. time.sleep(0.8)
  45. userData.close()
  46. print("Congratulations, You are now logged in as,",userName + str("!"))
  47. if optionOf == "B":
  48. print("You are now singing up...")
  49. newPage()
  50. userName = input("Username: ")
  51. userData = open("userData.txt","r")
  52. for loop in range (9):
  53. readData = userData.readline()
  54. splitData = readData.split(",")
  55. if splitData[0] == userName:
  56. print("We found your account!")
  57. passWord = input("Password: ")
  58. if splitData[1] == passWord:
  59. print("Account Found, You are now logged in,",userName,str("."))
  60. else:
  61.  
  62. print("Invalid Credentials")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement