平均的なtemptureを私のPythonコードに表示したいと思います。平均体温(python)を取得するpyowmを使用
私は、次のコードを作った彼らのAPIで、http://openweathermap.org/が見つかりました:まだtempature機能は、例えば、複数の変数が表示され
import pyowm
api = pyowm.OWM('Your API key')
collectinfo = api.weather_at_place("Gorinchem,nl")
short = collectinfo.get_weather()
temperature = short.get_temperature('celsius')
print(temperature)
一時 ':18.72、 'temp_max':20.0、 'temp_min':17.0、 'temp_kf':なし
は、私は私ができるように、ちょうど平均temptureが変数に書かれているのが好きないだろう私のプログラムでそれを使用してください。それはhttps://pyowm.readthedocs.io/en/latest/pyowm.webapi25.html#module-pyowm.webapi25.observation
(使用CTRL + F、摂氏の検索:ドキュメントへ
class pyowm.webapi25.historian.Historian(station_history)
リンクの一部
average_temperature(unit='kelvin')
:
いくつか検索した後、私は次のコード行を見つけました
私はそれを使用する手がかりがありません平均温度に対する関数。
開始コーダーを助けることができる人は誰ですか:))?
。 evalのセキュリティ上のリスクはありません。 –
@AntonvanderWel私はそう思います。 –