def build_list_of_people_from_csv(filename, countries):
people = []
with open(filename, 'r') as opened_file:
reader = csv.reader(opened_file)
for row in reader:
excluded_countries = []
if len(row) > 1:
excluded_countries = [
sanitize_string(name)
for name in row[1].split(',')
]
people.append(
Person(
name=row[0],
countries=countries,
excluded_countries=excluded_countries
)
)
return people
评论列表
文章目录