Feb-11-2018, 05:56 PM
input_file = open('dictionaryHmong.txt') dictionary = {} for lines in input_file: information = lines.split(',') dictionary[lines[0]] = {'Hmong': lines[1], 'English': lines[2]}
Error:<module>
dictionary[lines[0]] = {'Hmong': lines[1], 'English': lines[2]}
builtins.IndexError: string index out of range
So I am trying to set up a dictionary from a text file but I have tried multiple ways of doing it and this was my last try with no luck.The file looks like this:
1,raws li,as
2,kuv,I
3,nws,his
and so on
I need to get this to work before i start the rest of the program.
Thanks in advance!