Skip to content

Instantly share code, notes, and snippets.

Created March 16, 2016 17:01
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chouch0u/51ef8e9944257a437aeb to your computer and use it in GitHub Desktop.
将 Eudic 网页版本导出的生词本单词转换为 Anki 可用的格式。
import sys
import re
import os
if os.path.isfile(sys.argv[2]):
eudic = open(sys.argv[1])
anki = open(sys.argv[2], 'a')
lines = []
for i in eudic:
world = []
for i in lines:
txt = ""
for i in world:
meaning = ""
for n in range(2, len(i)):
meaning = meaning + i[n]
meaning = re.sub(",", ";", meaning)
txt = i[1] + "," + meaning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment