import json
data ={
'city':'北京市'
}
url = 'http://wthrcdn.etouch.cn/weather_mini'
#res = requests.get(url,data)
#print(res.json())
def send_get(url,data):
res = requests.get(url=url,params=data).json()
return json.dumps(res,indent=2)
你没有调用这个函数,最下面增加一句send_get(url,data)
额,没有调用呀,要写print(send_get(url, data))没print不输出,没()不调用
欸,抢个沙发