本文整理汇总了Python中weather.Weather.extractData方法的典型用法代码示例。如果您正苦于以下问题:Python Weather.extractData方法的具体用法?Python Weather.extractData怎么用?Python Weather.extractData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weather.Weather
的用法示例。
在下文中一共展示了Weather.extractData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkWeather
# 需要导入模块: from weather import Weather [as 别名]
# 或者: from weather.Weather import extractData [as 别名]
def checkWeather(self):
wi = WeatherInfo()
wi.parse(self._location)
newWeather = Weather()
newWeather.extractData(wi,self._unit)
self._weather = newWeather
self.update()
示例2: checkWeather
# 需要导入模块: from weather import Weather [as 别名]
# 或者: from weather.Weather import extractData [as 别名]
def checkWeather(self):
wi = WeatherInfo()
mapper = ConditionMapper()
wi.parse()
weather = Weather()
weather.extractData(wi, self._unit)
self.lb_location.setText("Location: " + weather.location)
self.lb_temperature.setText(weather.current_temperature)
self.lb_condition.setText("Condition: " + weather.current_condition)
self.lb_humidity.setText(weather.current_humidity)
self.lb_wind.setText(weather.current_wind)
# current condition image
self.svg_current.setImagePath(self._image_prefix + mapper.getMappedImageName(weather.current_condition))
self.svg_current.resize(self._big_img_width, self._big_img_height)
self.svg_w_current.setSvg(self.svg_current)
# load forecast days
fc_day = weather.fc_dl[0]
# self.lb_day_fc1.setText("Tomorrow")
self.lb_day_fc1.setText(fc_day)
fc_day = weather.fc_dl[1]
self.lb_day_fc2.setText(fc_day)
fc_day = weather.fc_dl[2]
self.lb_day_fc3.setText(fc_day)
# load forecast images
fc = weather.fc_conditions[0]
print fc
self.svg_fc1.setImagePath(self._image_prefix + mapper.getMappedImageName(fc))
self.svg_fc1.resize(self._img_width, self._img_height)
self.svg_w_fc1.setSvg(self.svg_fc1)
fc = weather.fc_conditions[1]
print fc
self.svg_fc2.setImagePath(self._image_prefix + mapper.getMappedImageName(fc))
self.svg_fc2.resize(self._img_width, self._img_height)
self.svg_w_fc2.setSvg(self.svg_fc2)
fc = weather.fc_conditions[2]
print fc
self.svg_fc3.setImagePath(self._image_prefix + mapper.getMappedImageName(fc))
self.svg_fc3.resize(self._img_width, self._img_height)
self.svg_w_fc3.setSvg(self.svg_fc3)
self.lb_temp_fc1.setText(weather.fc_low_high[0])
self.lb_temp_fc2.setText(weather.fc_low_high[1])
self.lb_temp_fc3.setText(weather.fc_low_high[2])
# self.layout.addItem(label)
# self.setLayout(self.layout)
self.update()
示例3: WeatherInfo
# 需要导入模块: from weather import Weather [as 别名]
# 或者: from weather.Weather import extractData [as 别名]
#!/usr/bin/env python
from weatherInfo import WeatherInfo
from weather import Weather
wi = WeatherInfo()
wi.parse()
weather = Weather()
weather.extractData(wi,"SI")
weather.show()
示例4: WeatherInfo
# 需要导入模块: from weather import Weather [as 别名]
# 或者: from weather.Weather import extractData [as 别名]
#!/usr/bin/env python
from weatherInfo import WeatherInfo
from weather import Weather
wi = WeatherInfo()
wi.parse("Munich,Germany")
weather = Weather()
#weather.extractData(wi,"Metric")
weather.extractData(wi,"Imperial")
weather.show()