When creating dictionary can't assign data if key was not created e.g.
Код: Выделить всё
dct = {}
dct['main']['sub'] = 'Hello World'
Код: Выделить всё
dct = {}
dct['main'] = {}
dct['main']['sub'] = 'Hello World'
Код: Выделить всё
dct['main']['sub'] = 'Hello World'
Источник: https://stackoverflow.com/questions/781 ... uses-error