From 75a42ec54dbf721caa659ddf02c1f46fc2cb4bef Mon Sep 17 00:00:00 2001 From: mlot Date: Fri, 6 Jun 2025 13:40:57 -0400 Subject: initial commit for archiving --- Chap6ProjPasswordLock | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Chap6ProjPasswordLock (limited to 'Chap6ProjPasswordLock') diff --git a/Chap6ProjPasswordLock b/Chap6ProjPasswordLock new file mode 100644 index 0000000..090e68d --- /dev/null +++ b/Chap6ProjPasswordLock @@ -0,0 +1,24 @@ +#! /usr/bin/env python3 + +# Password Manager Chap. 6 + +PASSWORDS = {'email': 'ihwbrfh3rhbfwhbdifuhsud', + 'blog': '974y5h34kr73ihfi3', + 'luggage': '12345'} + +import sys +import pyperclip + +if len(sys.argv) < 2: + print('Usage: python pw.py [account] - copy account password.') + sys.exit() + +account = sys.argv[1] + +if account in PASSWORDS.keys(): + pyperclip.copy(PASSWORDS[account]) + print('The password for ' + account + ' has been copied to the clipboard.') +else: + print('There is no account named ' + account) + +sys.exit() -- cgit