ソースを参照

OpenWeatherMap温湿度返回整型

locky 1 年間 前
コミット
e1bb952645
1 ファイル変更2 行追加2 行削除
  1. 2 2
      Object/IPWeatherObject.py

+ 2 - 2
Object/IPWeatherObject.py

@@ -217,6 +217,6 @@ class OpenWeatherMap:
         res_data = eval(res.text)
         if res_data['cod'] != 200:
             return None, None
-        temp = res_data['main']['temp']
-        humidity = res_data['main']['humidity']
+        temp = int(res_data['main']['temp'])
+        humidity = int(res_data['main']['humidity'])
         return temp, humidity