Skip to content

Instantly share code, notes, and snippets.

@uroybd
Created April 18, 2020 18:48
Show Gist options
  • Save uroybd/6e7af0e097677ca8eb8133b1012e4a77 to your computer and use it in GitHub Desktop.
Save uroybd/6e7af0e097677ca8eb8133b1012e4a77 to your computer and use it in GitHub Desktop.
Creating Stardict from python dict.
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