14 lines
339 B
Python
Executable File
14 lines
339 B
Python
Executable File
import urllib.request
|
|
import json
|
|
|
|
LAT = "38.2544472"
|
|
LON = "-104.609141"
|
|
KEY = "4ce85a140d8c4ee1c933d953a39697b6"
|
|
|
|
data = urllib.request.urlopen("https://api.openweathermap.org/data/2.5/weather?lat="+LAT+"&lon="+LON+"&appid="+KEY+"&units=imperial").read()
|
|
|
|
temperature = json.loads(data)["main"]["temp"]
|
|
|
|
print(f"{int(temperature)}°F")
|
|
|