Guest User

Untitled

a guest
Mar 3rd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. import time
  2.  
  3. user = raw_input("Username: ")
  4. pw = raw_input("Password: ")
  5. if user == "PrOoOg" and pw == "aka443":
  6. def add_acc_func(acc, user, pw):
  7. database.write("nAccount: ")
  8. database.write(acc)
  9. database.write(" Username: ")
  10. database.write(user)
  11. database.write(" Password: ")
  12. database.write(pw)
  13. database.close()
  14.  
  15.  
  16. def print_database_func():
  17. for lines in database.readlines():
  18. print lines.strip('n')
  19. database.close()
  20.  
  21. user_input = raw_input('Press "A" to add a new accountnPress "M" to modify and existing accountn'
  22. 'Press "D" to delete and existing accountnPress "S" to show all accounts and passwordsn')
  23. user_choice = user_input.lower()
  24. if user_choice == "a":
  25. database = open("source.txt", "a") #Everything worked fine when i deleted this line
  26. acc_to_add = raw_input("Write the name of the site or service: ").lower()
  27. acc_to_add_user = raw_input("Write the username or email you want to set for that account: ")
  28. acc_to_add_pw = raw_input("Write the password you want to set to that account: ")
  29. add_acc_func(acc_to_add, acc_to_add_user, acc_to_add_pw)
  30. print "Account added"
  31.  
  32.  
  33. if user_choice == "s":
  34. database = open("source.txt", "r") #Everything worked fine when i deleted this line
  35. print_database_func()
  36.  
  37. raw_input("Press Enter to quit")
  38. else:
  39. print ("Wrong username or password")
  40. time.sleep(3)
Add Comment
Please, Sign In to add comment