From 47af40f2b7ec1500923dd857f0c2f82d076bdda7 Mon Sep 17 00:00:00 2001 From: Sumanyu3 <43872870+Sumanyu3@users.noreply.github.com> Date: Fri, 5 Oct 2018 12:06:42 +0530 Subject: [PATCH] Update weather.py --- weather.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weather.py b/weather.py index 9ca9555..3817260 100644 --- a/weather.py +++ b/weather.py @@ -4,7 +4,7 @@ def weather_response(location, API_key):#Function for getting the json string url =urllib.request.urlopen('url till location'+location+'&APPID='+API_key) json = url.read()#.decode('utf-8') return str(json) -def has_error(json,location): +def has_error(json,location): #has error or not json=str(json) if json == str(b'{"cod":"404","message":"city not found"}'): print("error 404,city not found") @@ -78,4 +78,4 @@ def get_wind(json,n=0,t='03:00:00'): finding_comma = sliced_1.find(',',wind_index) wind = sliced_1[wind_index:finding_comma] wind = float(wind) - return wind \ No newline at end of file + return wind