Use pipeable.stdout instead of print.
This commit is contained in:
parent
a40dff9f49
commit
db2fab6628
2 changed files with 4 additions and 3 deletions
|
@ -5,13 +5,14 @@ import argparse
|
||||||
import pyperclip
|
import pyperclip
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from voussoirkit import pipeable
|
||||||
|
|
||||||
def clipboard_argparse(args):
|
def clipboard_argparse(args):
|
||||||
if args.output_file:
|
if args.output_file:
|
||||||
open(args.output_file, 'w', encoding='utf-8').write(pyperclip.paste())
|
open(args.output_file, 'w', encoding='utf-8').write(pyperclip.paste())
|
||||||
else:
|
else:
|
||||||
text = pyperclip.paste()
|
text = pyperclip.paste()
|
||||||
text = text.replace('\r', '')
|
pipeable.stdout(text)
|
||||||
print(text)
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
2
repr.py
2
repr.py
|
@ -1,4 +1,4 @@
|
||||||
from voussoirkit import pipeable
|
from voussoirkit import pipeable
|
||||||
|
|
||||||
for line in pipeable.go():
|
for line in pipeable.go():
|
||||||
print(repr(line))
|
pipeable.stdout(repr(line))
|
||||||
|
|
Loading…
Reference in a new issue