blob: 090e68de81ef5ca83f4dbb2636342ce417ff73cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()
|