Skip to content

Instantly share code, notes, and snippets.

@nobuh
Created April 17, 2023 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobuh/3b5c8a4d49d9e53a933a0437eb803094 to your computer and use it in GitHub Desktop.
Save nobuh/3b5c8a4d49d9e53a933a0437eb803094 to your computer and use it in GitHub Desktop.
クリップボード入出力サンプル
# 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