Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- # pcb.pyw - Saves and loads pieces of text to the clipboard.
- # Usage: py.exe mcb.pyw save <keyword> - Save clipboard to key word.
- # py.exe mcb.pyw <keyword> - Loads keyword to clipboard.
- # py.exe mcb.pyw list - Loads all key words to clipboard.
- import shelve
- import pyperclip
- import sys
- mcbShelf = shelve.open('mcb')
- # Save clipboard content.
- if len(sys.argv) == 3 and sys.argv[1].lower() == 'save':
- mcbshelf[sysargv[2]] = pyperclip.paste()
- elif len(sys.argv) == 2:
- # List keywords and load content.
- if sys.argv[1].lower() == 'list':
- pyperclip.copy(str(list(mcbShelf.keys())))
- elif sys.argv[1] in mcbShelf:
- pyperclip.copy(mcbShelf[sys.argv[1]])
- mcbShelf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement