Skip to content

Instantly share code, notes, and snippets.

@pkqk
Forked from ntlk/uniq.py
Last active December 25, 2015 09:29
Show Gist options
  • Save pkqk/6954645 to your computer and use it in GitHub Desktop.
Save pkqk/6954645 to your computer and use it in GitHub Desktop.
import sys
def process_lines(lines):
last_line = None
for line in lines:
if line != last_line:
sys.stdout.write(line)
last_line = line
process_lines(sys.stdin.readlines())
@ntlk
Copy link

ntlk commented Oct 12, 2013

Oh, nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment