Hi
I'm using different levels of subdictionnaries in order to sort types of data (In the same idea of directories and sub-directories) ; it works fine. To update or add new ones, I need to provide explicitly the structure such as:
Of course I can use the next code, but it's better to avoid it, isn't it?
Paul
I'm using different levels of subdictionnaries in order to sort types of data (In the same idea of directories and sub-directories) ; it works fine. To update or add new ones, I need to provide explicitly the structure such as:
MyDict[subdict][subsubdict].update(Newdict)In the previous example, everything is variable (subdict, subsubdict and so on); I'm wondering if ther's a way to remplace what I'm calling here a "path" by a variable, i.e. "[subdict][subsubdict]" by a kind of "path = [subdict][subsubdict]"?
Of course I can use the next code, but it's better to avoid it, isn't it?
path = '[subdict][subsubdict]' exec("MyDict%s.update(Newdict)" % path )Thanks for any suggestion.
Paul