import sys match = [] with open(sys.argv[1]) as fh: for line in fh: if line in match: pass else: match.append(pass)