首页 > 代码库 > PYTHON WEATHER

PYTHON WEATHER

小玩一下python强大的库文件,调api获取天气情况

#coding:utf-8import urllibimport jsoncontent = urllib.urlopen(http://m.weather.com.cn/data/101040100.html).read()s = json.loads(content)print s["weatherinfo"]["city"]print s["weatherinfo"]["weather2"]

 

PYTHON WEATHER