with open('results.txt') as infile:
    counts = collections.Counter(l.strip() for l in infile)
for line, count in counts.most_common():
    pass
Python: How to count how many lines in a file are the same