当前位置: 首页 > news >正文

建站资源免费加强企业门户网站建设

建站资源免费,加强企业门户网站建设,网站模板 协会,国外vps国内vps(1)程序查询结果图(图中较下的图是百度查询天气的结果)(2)http://developer.baidu.com/map/carapi-7.htm 百度车联网接口说明中有天气查询的接口#xff0c;目前是免费提供的(一天可以查询5000次)下表是接口返回的json数据。(表中##及后内容是为了方便的查看数据填写的){‘dat…(1)程序查询结果图(图中较下的图是百度查询天气的结果)(2)http://developer.baidu.com/map/carapi-7.htm 百度车联网接口说明中有天气查询的接口目前是免费提供的(一天可以查询5000次)下表是接口返回的json数据。(表中##及后内容是为了方便的查看数据填写的){‘date‘: ‘2015-03-24‘, ‘error‘: 0,##begin results‘results‘:[{‘pm25‘: ‘95‘,##begin index‘index‘:[{‘des‘: ‘建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。‘, ‘tipt‘: ‘穿衣指数‘, ‘zs‘: ‘较冷‘, ‘title‘: ‘穿衣‘},{‘des‘: ‘较适宜洗车未来一天无雨风力较小擦洗一新的汽车至少能保持一天。‘, ‘tipt‘: ‘洗车指数‘, ‘zs‘: ‘较适宜‘, ‘title‘: ‘洗车‘},{‘des‘: ‘天气较好风稍大但温度适宜是个好天气哦。适宜旅游您可以尽情地享受大自然的无限风光。‘, ‘tipt‘: ‘旅游指数‘, ‘zs‘: ‘适宜‘, ‘title‘: ‘旅游‘},{‘des‘: ‘昼夜温差较大较易发生感冒请适当增减衣服。体质较弱的朋友请注意防护。‘, ‘tipt‘: ‘感冒指数‘, ‘zs‘: ‘较易发‘, ‘title‘: ‘感冒‘},{‘des‘: ‘天气较好但因风力稍强户外可选择对风力要求不高的运动推荐您进行室内运动。‘, ‘tipt‘: ‘运动指数‘, ‘zs‘: ‘较适宜‘, ‘title‘: ‘运动‘},{‘des‘: ‘属中等强度紫外线辐射天气外出时建议涂擦SPF高于15、PA的防晒护肤品戴帽子、太阳镜。‘, ‘tipt‘: ‘紫外线强度指数‘, ‘zs‘: ‘中等‘, ‘title‘: ‘紫外线强度‘}],##///end index##..........................................................begin weather_data 今天起的4天气候‘weather_data‘:[{‘nightPictureUrl‘: ‘http://api.map.baidu.com/images/weather/night/qing.png‘, ‘weather‘: ‘晴‘, ‘temperature‘: ‘3℃‘, ‘date‘: ‘周二 03月24日(实时15℃)‘, ‘wind‘: ‘微风‘, ‘dayPictureUrl‘: ‘http://api.map.baidu.com/images/weather/day/qing.png‘},{‘nightPictureUrl‘: ‘http://api.map.baidu.com/images/weather/night/qing.png‘, ‘weather‘: ‘晴‘, ‘temperature‘: ‘18 ~ 6℃‘,‘date‘: ‘周三‘, ‘wind‘: ‘南风3-4级‘, ‘dayPictureUrl‘: ‘http://api.map.baidu.com/images/weather/day/qing.png‘},{‘nightPictureUrl‘: ‘http://api.map.baidu.com/images/weather/night/qing.png‘, ‘weather‘: ‘晴‘, ‘temperature‘: ‘20 ~8℃‘, ‘date‘: ‘周四‘, ‘wind‘: ‘微风‘, ‘dayPictureUrl‘: ‘http://api.map.baidu.com/images/weather/day/qing.png‘},{‘nightPictureUrl‘: ‘http://api.map.baidu.com/images/weather/night/yin.png‘, ‘weather‘: ‘多云转阴‘, ‘temperature‘: ‘22~ 10℃‘, ‘date‘: ‘周五‘, ‘wind‘: ‘南风3-4级‘, ‘dayPictureUrl‘: ‘http://api.map.baidu.com/images/weather/day/duoyun.png‘}],##............................................................end weather_data‘currentCity‘: ‘北京‘}],##end results‘status‘: ‘success‘}import jsonimport urllib.requestimport urllib.parseurl0 http://api.map.baidu.com/telematics/v3/weatherurl http://api.map.baidu.com/telematics/v3/weather?location北京outputjsonakyourkeyurl1 https://www.python.org/###最简单的方式##response urllib.request.urlopen(url1)##buff response.read()##html buff.decode(utf8)##response.close()#记得关闭##print(html)###使用Request的方式这种方式同样可以用来处理其他URL例如FTP##import urllib.request##req urllib.request.Request(url1)##response urllib.request.urlopen(req)##buff response.read()###显示##the_page buff.decode(utf8)##response.close()##print(the_page)#使用GET请求#例子中用到百度车联网中提供的天气查询api接口#http://api.map.baidu.com/telematics/v3/weather?location北京outputjsonakyourkey#http://api.map.baidu.com/telematics/v3/weather?location北京outputjsonakyourkey#decode(gb2312)name1input(请输入城市:)#url1 http://api.map.baidu.com/telematics/v3/weather?locationname1outputjsonakyourkey#print(url1)data {location:name1,output:json,ak:RehcDwqFhr77yNTZVGKPA45U}#ak后面的值是我在百度上申请的keyurl_values urllib.parse.urlencode(data)full_url url0 ? url_values#print(full_url)f urllib.request.urlopen(full_url)weatherHTML f.read().decode(utf-8)#读入打开的urlweatherJSON json.JSONDecoder().decode(weatherHTML)#创建json#print(weatherHTML)#print(weatherJSON)print()results weatherJSON[results]print(当前城市:,results[0][currentCity])#当天的天气建议index results[0][index]for each_index in index:print(each_index[title],:,each_index[zs])weather_data results[0][weather_data]for each_data in weather_data:print(时间%s 天气%s 温度:%s 风力:%s %(each_data[date],each_data[weather],each_data[temperature],each_data[wind]))import osos.system(pause)原文http://blog.csdn.net/lxz26192/article/details/44618491
http://www.zqtcl.cn/news/538985/

相关文章:

  • 石家庄营销型网站建设公司服装公司网站源码
  • 网站开发的软硬件需求做网站盘锦
  • 创意网站建设排行榜python和php哪个做网站
  • 开锁做网站怎么样榆林网站开发公司
  • 松原市建设局网站苏州网站建设-中国互联
  • 标书制作教程视频网站福田祥菱v1单排
  • 点网站出图片怎么做能看人与动物做的网站
  • 免费开源建站系统源码wordpress公共函数在哪里
  • 西昌市建设工程管理局网站模块化网站开发
  • 无限看片的视频大全免费下载上海网络优化方法
  • 物流公司做网站注重什么问题中国建设银行征信中心网站
  • 教务处网站建设专业做鞋子的网站吗
  • 梦幻创意网站建设成都做网站设计哪家便宜
  • 织梦网站栏目修改教程丝绸之路网站建设意义
  • 如何知道一个网站是谁做的北京装饰公司前十名
  • 杭州网站建设哪个平台好visualstudio 做网站
  • 广州站是哪个站h5建站系统
  • 网站首页网址应该有对应的域名南京高端模板建站
  • 自己做的网站竞价优化怎么做网站流量赚钱吗
  • 人力资源网站建设mip网站模板
  • 太原市住房和城乡建设部网站网站 备案 换空间
  • 怎么做网站备份网站运营数据周报表怎么做
  • 度更新网站做详情页网站
  • 酷炫网站模板wordpress自动发货插件
  • 网站做多个镜像wordpress无法显示向导
  • 交易类网站建设费用工厂招工最新招聘信息
  • 俄语网站建设网站建设的实训报告
  • 朝阳市做网站的公司wordpress msg
  • 企业管理系统免费版seo关于网站
  • 几度设计网站设计制作平板电脑支架