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