Skip to content

Instantly share code, notes, and snippets.

@Jonty
Forked from ntlk/uniq.py
Created October 12, 2013 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jonty/6954648 to your computer and use it in GitHub Desktop.
Save Jonty/6954648 to your computer and use it in GitHub Desktop.
import sys
def process_lines(lines):
for index, line in enumerate(lines):
last_line = lines[index - 1]
if line != last_line:
sys.stdout.write(line)
process_lines(sys.stdin.readlines())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment