def subkey ( dct , keys ) : key = keys [ 0 ] if len ( keys ) == 1 : return dct [ key ] return subkey ( dct [ key ] , keys [ 1 : ] )
python interploating a key from a dict
Get an entry from a dict of dicts by the list of keys to follow
def subkey(dct, keys):
    """Get an entry from a dict of dicts by the list of keys to 'follow'
    """
    key = keys[0]
    if len(keys) == 1:
        return dct[key]
    return subkey(dct[key], keys[1:])