How would you assign to a dictionary contained in a dictionary?
>>> outer = {'inner': { 'foo': 'bar' }}
>>> print outer['inner']['foo']
bar
>>> outer['inner']['foo'] = 'baz'
>>> print outer['inner']['foo']
baz
globals() just returns the dictionary in which global variables are stored. The variable names are the keys. So you access it (and any nested structures inside it) the same way you would with any other dictionary.
>>> globals()['outer']['spoon'] = 'fork'
>>> print outer['spoon']
'fork'
If you find this confusing, just break it up into one step at a time using more intermediate variables:
>>> g = globals() # fetch the globals() dictionary into g
>>> o = g['outer'] # fetch the outer dictionary from g into o
>>> o['spoon'] = 'fork' # store 'fork' under the key 'spoon' in o
Try to do that same "breaking up into smaller steps" with your attempted syntax, and you'll find that you get:
>>> g = globals() # fetch the globals() dictionary into g
>>> g["b['c']"] = 5 # store 5 under the key "b['c']" in g
Here you've inserted a value with into a dictionary with the key "b['c']". Which is a perfectly fine thing to do with a dictionary, so you don't get any errors. But it's utter nonsense mapped back to variables.
What you've done corresponds to the creation of a variable with the name b['c']. Not a variable named b referring to a dictionary with a key 'c'. There is no way to actually refer to this variable without going through globals(), because that's not a valid Python identifier. Every time you try to write it out Python will just interpret it as you referring to a key inside a variable named b.
globals()["b['c']"] = 5? What is this supposed to do? There's no variable with the nameb['c']. Why are you trying to use this as a variable name? - S.Lott