Created
April 17, 2023 05:40
-
-
Save nobuh/3b5c8a4d49d9e53a933a0437eb803094 to your computer and use it in GitHub Desktop.
クリップボード入出力サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pw.py - パスワード管理プログラム(脆弱なので使わないこと) | |
PASSWORDS = {'email': 'faregjnfapetugpaetrhgpqwg', | |
'blog': '4fjq-3085gjq-305g-', | |
'luggage': '12345'} | |
import sys | |
import pyperclip | |
if len(sys.argv) < 2: | |
print('使い方: python pw.py [アカウント名]') | |
print('パスワードをクリップボードにコピーします') | |
sys.exit() | |
account = sys.argv[1] | |
if account in PASSWORDS: | |
pyperclip.copy(PASSWORDS[account]) | |
print(account + 'のパスワードをクリップボードにコピーしました') | |
else: | |
print(account + 'というアカウント名はありません') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment