代码:
#! python3
# python 编程-----口令保管箱passwords={'emails':'' 'F7minlBDDuvMJuxESSKHFhTxFtjVB6','blog':'VmALvQyKAxiVH5G8v01if1MLZF3sdt','luggage':'12345',}
import sys,pyperclip
if len(sys.argv)<2:print('usage:python python3文件[accout]-copy accout password')sys.exit()accout=sys.argv[1] # frist command line arg is the accout nameif accout in passwords:pyperclip.copy(passwords[accout])print('Password for ' + accout + ' copied to clipboard')else:print('There is no accout named ' + accout)
添加批处理脚本:
@D:\python\python.exe D:\pythonpassword\pythonpassword.py %*
@pause
添加环境变量,然后直接win+R,输入pw+ 需要的账户,就能提取到对应的密码,直接可以执行粘贴,方便平常输入密码。