当前位置: 首页>>代码示例>>Python>>正文


Python Weather.extractData方法代码示例

本文整理汇总了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()
开发者ID:josemariaruiz,项目名称:plasma_pyweather2,代码行数:11,代码来源:main.py

示例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()
开发者ID:rangalo,项目名称:plasma_pyweather,代码行数:58,代码来源:main.py

示例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()
开发者ID:GunioRobot,项目名称:plasma_pyweather,代码行数:13,代码来源:testWeather.py

示例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()
开发者ID:josemariaruiz,项目名称:plasma_pyweather2,代码行数:14,代码来源:testWeather.py


注:本文中的weather.Weather.extractData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。