Guest User

mclip

a guest
Dec 24th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. #!/usr/bin/python3
  2. #mclip.py - A multi-clipboard program.
  3.  
  4. TEXT = {'agree':"""Yes, I agree.That sounds fine to me.""",
  5.         'busy':"""sorry, can we do this later this week or next week""",
  6.         'upsell':"""would you consider making this a monthly donation?"""}
  7.  
  8. import sys,pyperclip
  9. if len(sys.argv) < 2:
  10.     print('Usage: python mclip.py [keyphrase] - copy phrase text')
  11.     sys.exit()
  12.  
  13. keyphrase = sys.argv[1]     #first command line arg is keyphrase
  14.  
  15.  
  16. if keyphrase in TEXT:
  17.     pyperclip.copy(TEXT[keyphrase])
  18.     pyperclip.paste()
  19.  
  20.     print('Text for ' + keyphrase + ' copied to clipboard')
  21.    
  22. else:
  23.     print('There is no text for' + keyphrase)
Add Comment
Please, Sign In to add comment