基于Dragonbaord 410c开发板的Python交互设计(3)——天气预报xml数据解析
weatherXml.readNext()
elif weatherXml.name()=="environment":
print("environment")
while not weatherXml.atEnd():
print("test")
if weatherXml.name()=="suggest":
self.weather_suggest=weatherXml.readElementText()
print("suggest")
break
else:
weatherXml.readNext()
elif weatherXml.name()=="forecast":
#print(weatherXml.readElementText())
print("forecast")
weatherXml.readNext()
while not weatherXml.atEnd():
if weatherXml.isStartElement():
if weatherXml.name()=="weather":
weatherXml.readNext()
while not weatherXml.atEnd():
if weatherXml.isStartElement():
if weatherXml.name()=="date":
#print("weather info")
date = weatherXml.readElementText()
self.forecast_weather_info_date.append(date)
weatherXml.readNext()
DragonBoard 410c python XML 相关文章: