On Wednesday 2013 November 20 05:44, Larry Wilson wrote: > >>> feed.entries[0].w_current > > {'temperature': u'20.3', 'dewpoint': u'18.6', 'windgusts': u'29.6', 'rain': > u'0.6', 'humidity': u'90', 'pressure': u'0.0', 'windspeed': u'22.2', > 'winddirection': u'SSW'} > > > in the above I get the subitem as shown. How do I extract the label, values > pairs?
Python 3.3.0 (default, Sep 30 2012, 09:02:56) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> w_current = {'temperature': u'20.3', 'dewpoint': u'18.6', 'windgusts': u'29.6', 'rain': u'0.6', 'humidity': u'90', 'pressure': u'0.0', 'windspeed': u'22.2', 'winddirection': u'SSW'} >>> for label, value in w_current.items(): ... print (label, value) ... dewpoint 18.6 temperature 20.3 rain 0.6 pressure 0.0 windspeed 22.2 humidity 90 winddirection SSW windgusts 29.6 >>> -- Yonder nor sorghum stenches shut ladle gulls stopper torque wet strainers. -- https://mail.python.org/mailman/listinfo/python-list