Created
April 18, 2020 18:48
-
-
Save uroybd/6e7af0e097677ca8eb8133b1012e4a77 to your computer and use it in GitHub Desktop.
Creating Stardict from python dict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
MY_DICT = {"a": "a definition"} # assuming this is your dict | |
data = list(MY_DICT.items()) | |
with open('glossary.txt', 'w') as gfile: | |
writer = csv.writer(gfile, delimiter="\t") | |
writer.writerows(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment