소스 검색

温湿度数据返回字符串

locky 1 년 전
부모
커밋
19622ffbc7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Object/IPWeatherObject.py

+ 2 - 2
Object/IPWeatherObject.py

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