Advertisement
Guest User

Untitled

a guest
May 8th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #! python3
  2. #  py.exe mcb.py save [keyword] -save current context in clipboard
  3. #  py.exe mcb.py list -list all keys saved before
  4. #  py.exe mcb.py [keyword] -paste the value related with the keyword to clipboard
  5.  
  6.  
  7. import sys, pyperclip, shelve
  8.  
  9. mcbfile = shelve.open('multiclipboard')
  10.  
  11. if len(sys.argv)==3 and sys.arge[1]=='save':
  12.     mcbfile[sys.argv[2]]=pyperclip.paste()
  13. elif len(sys.argv)==2:
  14.     if sys.argv[1]=='list':
  15.         pyperclip.copy(str(list(mcbfile.keys())))
  16.     else:
  17.         pyperclip.copy(mcbfile[sys.argv[1]])
  18. mcbfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement