""" Author: Mathieu Perreault (mathieu.perreault@gmail.com) """ core_list = [] periphery_list = [] for line in open('species.csv'): mylist = line.split(',') # An list representation of the line, split on commas stype = mylist[1] # Can be core or periphery sname = mylist[2] # Name of species if stype == "core": core_list.append(sname) else: # Must be periphery! periphery_list.append(sname) print "Core: ", len(core_list) print "Periphery: ", len(periphery_list)