Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #! python3
  2.  
  3. """This program will act as a password manager
  4. that will be executable from the command console.
  5. It will work by typing in a command line along with
  6. the account you want the password for. It will copy
  7. it from a database onto the pc clipboard, ready
  8. for you to paste where ever you want."""
  9.  
  10. # Code begins here
  11.  
  12. PASSWORDS = {"email": "4527", "facebook": "1234"}
  13.  
  14. import sys, pyperclip
  15. if len(sys.argv) < 2:
  16. print("Usage: python pw.py [account] - copy account password")
  17. sys.exit()
  18.  
  19. while True:
  20. print(list(PASSWORDS.keys()))
  21. print("Please select account:")
  22. account = sys.argv[1]
  23. pyperclip.copy(PASSWORDS.get(account, ""))
  24. if account in PASSWORDS.keys():
  25. print("Password for " + account + " copied!")
  26. break
  27. else:
  28. print("There is no password logged for account named " + account + ".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement