Pracownia_programowania/venv/Lib/site-packages/pyperclip/__main__.py

12 lines
447 B
Python
Raw Normal View History

2020-02-01 19:54:00 +01:00
import pyperclip
import sys
if len(sys.argv) > 1 and sys.argv[1] in ('-c', '--copy'):
pyperclip.copy(sys.stdin.read())
elif len(sys.argv) > 1 and sys.argv[1] in ('-p', '--paste'):
sys.stdout.write(pyperclip.paste())
else:
print('Usage: python -m pyperclip [-c | --copy] | [-p | --paste]')
print()
print('When copying, stdin will be placed on the clipboard.')
print('When pasting, the clipboard will be written to stdout.')