소스 검색

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