基于Dragonbaord 410c开发板的Python交互设计(3)——天气预报xml数据解析
#print(date)
elif weatherXml.name()=="high":
high=weatherXml.readElementText()
self.forecast_weather_info_high.append(high)
weatherXml.readNext()
#print(high)
elif weatherXml.name()=="low":
low=weatherXml.readElementText()
self.forecast_weather_info_low.append(low)
weatherXml.readNext()
#print(low)
elif weatherXml.name()=="day":
#print("day info")
weatherXml.readNext()
while not weatherXml.atEnd():
if weatherXml.isStartElement():
if weatherXml.name()=="type":
type = weatherXml.readElementText()
self.forecast_weather_info_dtype.append(type)
DragonBoard 410c python XML 相关文章: