Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. import time
  2. import sys
  3.  
  4.  
  5. def Signup():
  6.     print("Welcome to (Beta)pgczh mydbs mi")
  7.     print(
  8.         "Assuming this is your first time on this program,(I don't know how to tell or not) we will begin with the sign-up")
  9.     Username = input("Enter in your desired username")
  10.     print("Now time for your password")
  11.     Password = input("Enter in your desired password")
  12.     f = open("LoginInfo.txt", "w")
  13.     f.write(Password + ":" + Username)
  14.     f.close()
  15.     return Password, Username
  16.  
  17. def Login():
  18.     tries = 3
  19.     NameInput = input("Enter your username")
  20.     while NameInput != Username:
  21.         print("Incorrect Username, please try again")
  22.         NameInput = input("Enter your username")
  23.     while tries >= 0:
  24.         Input = input("Enter Your Password")
  25.         if Input == (Password):
  26.             Status = "Access Granted"
  27.             print('Access Granted')
  28.             return Status
  29.         else:
  30.             print('Access Denied, please try again')
  31.             print("You have: " + str(tries) + " attempts left")
  32.             tries -= 1
  33.         if tries == 0:
  34.             print("Your are out of attempts, Program now closing")
  35.             time.sleep(5)
  36.             exit()
  37.  
  38.  
  39. def Content():
  40.     if Status == "Access Granted":
  41.         print("I haven't really gotten this far yet soooo... ye thats it")
  42.  
  43.  
  44. Password, Username = Signup()
  45. Status = Login()
  46. Content()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement