live_scoreboard.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:live_scoreboard 作者: ClysmiC 项目源码 文件源码
def __asyncRequestWeatherData(self):
        success = False

        self.lastRequestedWeatherQueryTime = time.time()

        while not success:
            if not self.__isAlive:
                return

            try:
                self.__weatherInfo = hourlyForecast(WEATHER_LOCATION[0], WEATHER_LOCATION[1], wundergroundApiKey)
                success = True
            except:
                success = False
                currTime = datetime.now()
                print("FAIL: Weather request at {:02d}:{:02d}:{:02d}".format(currTime.hour, currTime.minute, currTime.second))

        currTime = datetime.now()
        print("SUCCESS: Weather request at {:02d}:{:02d}:{:02d}".format(currTime.hour, currTime.minute, currTime.second))

        self.lastSuccessfulWeatherQueryTime = time.time()
        self.newWeatherDataAvailable = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号