The value of my opening_hours key is a dictionary
and the value of periodsis a list which I would like to extract.
dic = {u'opening_hours': {u'open_now': True, u'periods': [{u'close': {u'day': 1, u'time': u'0100'}, u'open': {u'day': 0, u'time': u'0800'}}, {u'close': {u'day': 2, u'time': u'0100'}, u'open': {u'day': 1, u'time': u'0800'}}, {u'close': {u'day': 3, u'time': u'0100'}, u'open': {u'day': 2, u'time': u'0800'}}, {u'close': {u'day': 4, u'time': u'0100'}, u'open': {u'day': 3, u'time': u'0800'}}, {u'close': {u'day': 5, u'time': u'0100'}, u'open': {u'day': 4, u'time': u'0800'}}, {u'close': {u'day': 6, u'time': u'0100'}, u'open': {u'day': 5, u'time': u'0800'}}, {u'close': {u'day': 0, u'time': u'0100'}, u'open': {u'day': 6, u'time': u'0800'}}]}}
I'm stuck here, even though I was able to return the two keys(open_now and periods), I can't access periods' value.
How should I proceed?
>>> smalldict = dict[u'opening_hours']
>>> smallerdict = smalldict[u'periods']
Does this work?
smallerdict.