Created
October 27, 2015 20:18
-
-
Save cdhowie/87eac9417f35b2c5bf7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import fileinput | |
counts = {} | |
for line in fileinput.input(): | |
chomped = line.rstrip('\r\n') | |
counts[chomped] = counts.get(chomped, 0) + 1 | |
for line, count in counts.iteritems(): | |
print "%d\t%s" % (count, line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment