第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

世界天氣在線,pywwo軟件包安裝錯誤

世界天氣在線,pywwo軟件包安裝錯誤

慕尼黑5688855 2022-08-25 15:07:33
我正在嘗試使用世界天氣在線數(shù)據。在說明中,給出了我需要使用包。但是,當我第一次運行時,它給了我“無效的語法錯誤,即使沒有。我該如何處理?謝謝。pywwopip install pywwo
查看完整描述

2 回答

?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

我不認為pywwo再有效了。我使用的是pyowm,而不是:https://pyowm.readthedocs.io/en/latest/。您將需要一個API密鑰;按照這個得到一個:https://openweathermap.org/appid。


然后,您可以編寫一個函數(shù)來獲取溫度,如下所示:


def get_temp(zipcode:str)->int:

    """function to get weather using zipcode through pyOWM

    Arguments:

        zipcode {str} -- given by the user

    Returns:

        int -- temperature in fahrenheit returned by pyOWM

                for the current zipcode at the current time

    """

    owm = pyowm.OWM('YOUR API KEY GOES HERE')  # API key

    observation = owm.weather_at_zip_code(zipcode, "us")

    current_weather = observation.get_weather()

    temperature = current_weather.get_temperature('fahrenheit')['temp']

    return temperature


查看完整回答
反對 回復 2022-08-25
?
料青山看我應如是

TA貢獻1772條經驗 獲得超8個贊

您可以 git 克隆存儲庫,然后它們將導入到您的項目中。

我閱讀了文檔,沒有找到關于點數(shù)的信息。試試上面的方式。


查看完整回答
反對 回復 2022-08-25
  • 2 回答
  • 0 關注
  • 190 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號