else/Toolbox/clipboard.py

15 lines
314 B
Python
Raw Normal View History

2016-12-05 01:50:52 +00:00
'''
Dump the clipboard to stdout. I use this for redirecting to files.
'''
2016-11-18 06:24:52 +00:00
import pyperclip
import sys
if len(sys.argv) > 1:
2016-12-02 06:37:07 +00:00
from voussoirkit import clipext
2016-11-18 06:24:52 +00:00
stuff = clipext.resolve(sys.argv[1])
pyperclip.copy(stuff)
else:
text = pyperclip.paste()
text = text.replace('\r', '')
print(text)