Commit dd7cd711 by source_reader

added http demo

parent 785573e9
Showing with 9 additions and 0 deletions
import json
import requests
API_KEY = "--REDACTED--"
city_name = "Annapolis"
URL = "https://api.openweathermap.org/data/2.5/weather?q=%s&appid=%s&units=imperial" % (city_name, API_KEY)
r = requests.get(URL)
data = r.json()
print("It is currently %d degrees in %s" % (data['main']['temp'], city_name))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment