import sys file_path = sys.argv[1] def calculate(file_path): f = open(file_path,"r") lines = f.readlines() f.close() ll = [line.strip().split(",") for line in lines] ll = [l[0].strip() for l in ll] ll = list(set(ll)) print(ll[:3]) print(len(ll)) calculate(file_path)