Advertisement
mengyuxin

meng.multiClipboard.pyw

Jan 2nd, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. #! python3
  2. # pcb.pyw - Saves and loads pieces of text to the clipboard.
  3. # Usage: py.exe mcb.pyw save <keyword> - Save clipboard to key word.
  4. #        py.exe mcb.pyw <keyword> - Loads keyword to clipboard.
  5. #        py.exe mcb.pyw list - Loads all key words to clipboard.
  6.  
  7. import shelve
  8. import pyperclip
  9. import sys
  10.  
  11. mcbShelf = shelve.open('mcb')
  12.  
  13. # Save clipboard content.
  14. if len(sys.argv) == 3 and sys.argv[1].lower() == 'save':
  15.     mcbshelf[sysargv[2]] = pyperclip.paste()
  16. elif len(sys.argv) == 2:
  17.     # List keywords and load content.
  18.     if sys.argv[1].lower() == 'list':
  19.         pyperclip.copy(str(list(mcbShelf.keys())))
  20.     elif sys.argv[1] in mcbShelf:
  21.         pyperclip.copy(mcbShelf[sys.argv[1]])
  22.  
  23.  
  24. mcbShelf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement