else/Toolbox/unique.py
Ethan Dalool b5a1649bc0 else
2017-11-03 12:50:16 -07:00

20 lines
380 B
Python

'''
Keep the unique lines coming from stdin and print them.
'''
from voussoirkit import clipext
import sys
if len(sys.argv) > 1:
source = sys.argv[1]
else:
source = '!input'
lines = clipext.resolve(source, split_lines=True)
new_text = []
seen = set()
for line in lines:
if line not in seen:
#new_text.append(line)
seen.add(line)
print(line)