- 帖子
- 7
- 精华
- 0
- 积分
- 36
- 阅读权限
- 10
- 注册时间
- 2013-7-24
- 最后登录
- 2013-9-29
|
feicien 发表于 2013-7-24 09:03
我下载的是python3.3
发现语法与python2.7有很大区别,这是我在python3.3下写的代码
加了一个while循环,下面是运行的结果:- Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
- Type "copyright", "credits" or "license()" for more information.
- >>> ================================ RESTART ================================
- >>>
- 你想查询哪个城市的天气?输入q退出
- 北京
- {"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"36℃","temp2":"23℃","weather":"晴","img1":"d0.gif","img2":"n0.gif","ptime":"08:00"}}
- 你想查询哪个城市的天气?输入q退出
- 天津
- {"weatherinfo":{"city":"天津","cityid":"101030100","temp1":"36℃","temp2":"26℃","weather":"晴转多云","img1":"d0.gif","img2":"n1.gif","ptime":"08:00"}}
- 你想查询哪个城市的天气?输入q退出
- 上海、
- 你想查询哪个城市的天气?输入q退出
- 上海
- {"weatherinfo":{"city":"上海","cityid":"101020100","temp1":"39℃","temp2":"30℃","weather":"晴转多云","img1":"d0.gif","img2":"n1.gif","ptime":"08:00"}}
- 你想查询哪个城市的天气?输入q退出
- 杭州
- {"weatherinfo":{"city":"杭州","cityid":"101210101","temp1":"39℃","temp2":"29℃","weather":"晴","img1":"d0.gif","img2":"n0.gif","ptime":"08:00"}}
- 你想查询哪个城市的天气?输入q退出
- Q
- 退出!
- >>>
复制代码 |
|