Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 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].rstrip("\n\r")
  10. password = array[1].rstrip("\n\r")
  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.         else:
  19.             print("Incorrect")
  20.     else:
  21.         print("Incorrect")
  22.         print('\n--------------------------------------------------------\n')
  23. #  Login successful loop finished
  24. print("Welcome!")
  25. print('\n--------------------------------------------------------\n')
  26. print ("BTN = 0.10")
  27. print ("= £315.37")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement