1. 首页
  2. 数据库
  3. 其它
  4. python显示天气预报

python显示天气预报

上传者: 2021-01-01 01:59:24上传 PDF文件 26.53KB 热度 15次
复制代码 代码如下:import urllib2import jsonimport stringurl =’http://m.weather.com.cn/data/101090502.html’re = urllib2.urlopen(url).read()we = json.loads(re)[‘weatherinfo’]print we[‘city’] , we[‘date_y’].center(30) , we[‘week’]print we[‘temp1’], we[‘weather1’].center(30), we[‘wind1’]print we[‘temp2’], we
下载地址
用户评论