Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- # py.exe mcb.py save [keyword] -save current context in clipboard
- # py.exe mcb.py list -list all keys saved before
- # py.exe mcb.py [keyword] -paste the value related with the keyword to clipboard
- import sys, pyperclip, shelve
- mcbfile = shelve.open('multiclipboard')
- if len(sys.argv)==3 and sys.arge[1]=='save':
- mcbfile[sys.argv[2]]=pyperclip.paste()
- elif len(sys.argv)==2:
- if sys.argv[1]=='list':
- pyperclip.copy(str(list(mcbfile.keys())))
- else:
- pyperclip.copy(mcbfile[sys.argv[1]])
- mcbfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement