Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. print ("\nEnter details to access wallet...\n")
  2. """
  3. Open File
  4. """
  5. with open("Credentials.txt", "r") as f:
  6.     array = []
  7.     for line in f:
  8.         array.append(line) #stores username and password
  9. username = array[0]
  10. password = array[1]
  11. login = 0 #initial login status
  12. while login == 0: #as long as login status = 0 loop repeats
  13.     userInput = input("Username?\n")
  14.     if userInput == username:
  15.         userInput = input("Password?\n")  
  16.         if userInput == password:
  17.             login = 1 #login successful set login status to 1 thus breaking loop
  18.  
  19.         else:
  20.             print("Incorrect")
  21.     else:
  22.         print("Incorrect")
  23.         print('\n--------------------------------------------------------\n')
  24. #  Login successful loop finished
  25. print("Welcome!")
  26. print('\n--------------------------------------------------------\n')
  27. print ("BTN = 0.10")
  28. print ("= £315.37")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement