Advertisement
kacperthesexy

Untitled

Jul 8th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. print("Please set your Username and Password below!")
  2. Input_Username = input("Username: ")
  3. Input_Password = input("Password: ")
  4. print("\nUsername:",Input_Username,"\nPassowrd:",Input_Password)
  5. Y_or_N = input("Is this information correct? Y/N \n")
  6.  
  7. controller = False #Controller for Y_or_N
  8.  
  9. #WHILE FUNCTION FOR YES OR NO TO LOGIN
  10. while controller == False: #Continuous loop until the information is correct
  11. if Y_or_N == "y":
  12. controller = True
  13. elif Y_or_N == "n":
  14. print("Please set your Username and Password below!")
  15. Input_Username = input("Username: ")
  16. Input_Password = input("Password: ")
  17. print("\nUsername:",Input_Username,"\nPassowrd:",Input_Password)
  18. Y_or_N = input("Is this information correct? Y/N \n")
  19. else:
  20. Y_or_N = input("Invalid input, please re-enter your choice! Y/N \n")
  21.  
  22. #OPENING, READING AND WRITING FILES
  23. file = open("Data.txt", "a") # "w" write "a" append (save continuously)
  24. file.write(Input_Username + ", " + Input_Password + "\n")
  25. file.close()
  26. print("Your information has been saved")
  27.  
  28. file = open('Data.txt', 'r') #Opens and reads text file
  29. for line in file: # !REMOVE! Prints the Username and Password (My confirmation)
  30. print (line),
  31. file.close()
  32.  
  33.  
  34.  
  35.  
  36. Username = Input_Username #For use later
  37. Passowrd = Input_Password #For use later
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement