Skip to content

Instantly share code, notes, and snippets.

@skuzzymiglet
Created January 1, 2021 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skuzzymiglet/b3aa389a641d88a152569dd6d4838a57 to your computer and use it in GitHub Desktop.
Save skuzzymiglet/b3aa389a641d88a152569dd6d4838a57 to your computer and use it in GitHub Desktop.
extract digraphs as json from vim's display (old)
import json
f = open("raw", "r")
d = {}
for l in f.readlines():
fields = l.split(" ")
for f in fields:
f = f.split(" ")
try:
d[f[0]] = f[1]
except IndexError:
#print("wtf", f)
pass
print(d)
s = json.dumps(d, ensure_ascii=False)
o = open("dig.json", "w")
o.write(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment