diff --git a/openweather.py b/openweather.py index d2e7099..a9a24dc 100755 --- a/openweather.py +++ b/openweather.py @@ -15,7 +15,7 @@ response = requests.get(complete_url) data = response.json() -if data["cod"] != "404": +if response.status_code == 200: info_main = data["main"] info_weather = data["weather"] @@ -40,4 +40,5 @@ if data["cod"] != "404": ])) else: - print(" City Not Found ") + print(f"Fehler: {response.status_code}") + print(response.text)