Here's the code I am using. I need to be able to change the value of test["test1"]["test2"]["test3"]
from values contained in a list. This list could become longer or shorter. If the key doesn't exist I need to be able to create it.
test = {"test1": {"test2": {"test3": 1}}}
print test["test1"]["test2"]["test3"]
# prints 1
testParts = ["test1", "test2", "test3"]
test[testParts] = 2
print test["test1"]["test2"]["test3"]
# should print 2