Indentation is wrong in first code.
You can not do a dot'ed call on a dictionary.
You can not do a dot'ed call on a dictionary.
>>> results = {u'Relay1ON': 1800, u'Relay1OFF': u'0600'} >>> results.Relay1ON Traceback (most recent call last): File "<string>", line 301, in runcode File "<interactive input>", line 1, in <module> AttributeError: 'dict' object has no attribute 'Relay1ON' >>> results['Relay1ON'] 1800 >>> #Or get() >>> results.get('Relay1ON', 'Not here') 1800 >>> results = {u'Relay1ON999': 1800, u'Relay1OFF': u'0600'} >>> results.get('Relay1ON', 'Not here') 'Not here'