summaryrefslogtreecommitdiff
path: root/Chap6ProjPasswordLock
diff options
context:
space:
mode:
Diffstat (limited to 'Chap6ProjPasswordLock')
-rw-r--r--Chap6ProjPasswordLock24
1 files changed, 24 insertions, 0 deletions
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()