Skip to content

Instantly share code, notes, and snippets.

@a8568730
Last active August 25, 2017 03:21
Show Gist options
  • Save a8568730/d82ab7295aba8f148f1563e57c210ac1 to your computer and use it in GitHub Desktop.
Save a8568730/d82ab7295aba8f148f1563e57c210ac1 to your computer and use it in GitHub Desktop.
臺灣言語資料庫練習:列印辭典字串
import io
import csv
HuaTaiCsv = """ID,華語對譯,英文,台語羅馬字,台語漢字
1,曾祖父母,grandparents,a-chou2,阿祖
2,爺爺,grandfather,a-kong,阿公
3,媽媽,mother,a-bo2,阿母
"""
f = io.StringIO(HuaTaiCsv)
reader = csv.DictReader(f, delimiter=',')
for row in reader:
print(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment