这是我的问题我正在尝试编写一个脚本来获取我所在位置的天气这是代码
import requests
url = ("http://api.worldweatheronline.com/free/v1/weather.ashx?key=hfvb4qmehh8g9p8krcbmj8ew&q=48.85,2.35&fx=no&format=json")
r = requests.get(url)
forecast = r.json
print (forecast)["data"]["current_condition"]["temp_F"]
这是错误
<bound method Response.json of <Response [200]>>
Traceback (most recent call last):
File "C:\Users\Grant\Desktop\weather.py", line 6, in <module>
print (forecast) ["data"]["current_condition"]["temp_F"]
TypeError: 'NoneType' object is not subscriptable
任何帮助,将不胜感激