Created
May 19, 2012 08:40
-
-
Save jmahmood/2730102 to your computer and use it in GitHub Desktop.
Sticky Study Import File Generator
This file contains 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
o = open("Kanji_Vocab_List.txt") | |
contents = o.read().decode('utf8') | |
o.close() | |
c = contents.split() | |
words = [ (c[i], c[i+1]) for i in range(len(c)) if i%2==0 ] | |
# This is for testing actually writing the kanji. | |
output = [] | |
template = u"""%s\t%s\t%s\t%s""" | |
for k,r in words: | |
output.append( template % (r, r, r, k)) | |
print "\n".join(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment