Created
October 28, 2020 20:29
-
-
Save vschlegel/ed0bee31059325dff83c489a10ac8081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.8 | |
import requests | |
import urllib.parse | |
key= "xxxxx" # <-- Insert your own OpenWeatherMap API Key (https://openweathermap.org/api) | |
lat = "47.4212" | |
lon = "10.9863" | |
json = requests.get("http://api.openweathermap.org/data/2.5/weather?lat={}&lon={}&appid={}".format(lat, lon, key)).json() | |
if 'snow' in json: | |
print("Es schneit auf der Zugspitze"); | |
else: | |
print("Es schneit nicht auf der Zugspitze"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment