def get_countries_from_csv(filepath):
""" Process a csv countaining country data.
Args:
filepath (str): A path to a csv file.
Returns:
list: sanitized country names as strings.
Raises:
OSError: If file does not exist at the filepath.
"""
if not path.exists(filepath):
raise OSError('Path to file: "{}" does not exist.'.format(filepath))
with open(filepath, 'r') as csv_file:
reader = csv.reader(csv_file)
return [sanitize_string(''.join(row)) for row in reader]
eurovision.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录