用 python 查天气系列: 【Python 第43课】 查天气(1) http://bbs.crossincode.com/forum.php?mod=viewthread&tid=8 【Python 第44课】 查天气(2) http://bbs.crossincode.com/forum.php?mod=viewthread&tid=9 【Python 第45课】 查天气(3) http://bbs.crossincode.com/forum.php?mod=viewthread&tid=12 【Python 第46课】 查天气(4) http://bbs.crossincode.com/forum.php?mod=viewthread&tid=42 |
cyin15288 发表于 2013-7-25 11:02
Traceback (most recent call last):
File "", line 1, in
File "/System/Library/Frameworks/Python. ...
cyin15288 发表于 2013-7-25 11:02
Traceback (most recent call last):
File "", line 1, in
File "/System/Library/Frameworks/Python. ...
simple 发表于 2013-7-29 16:45
Traceback (most recent call last):
File "D:\Py\test\weather.py", line 10, in
from city import ...
wolfl 发表于 2013-9-11 09:29
Traceback (most recent call last):
File "C:\Python27\program\lesson43_weather.py", line 4, in
...
QQ截图20131008233808.png (24.02 KB, 下载次数: 341)
crossin先生 发表于 2015-5-17 00:45
如果是中文,会触发一次unicode到str的转换,但默认的编码不支持中文
你如改成 u('%s\n%s ~ %s') % (...) ...
周末晒被子 发表于 2015-12-10 12:36
Crossin先生,
result = data['weatherinfo']
这一句,是 result[n]==data['weatherinfo[n]'] 这样的意思吗 ...
周末晒被子 发表于 2015-12-10 21:46
表达有误....我是想表达result[n]是不是实质上相当于data['weatherinfo[n]'] ?
看了老师的回复,result ...
Kunz 发表于 2015-12-24 18:11
Traceback (most recent call last):
File "", line 83, in run
File "C:\Python34\lib\bdb.py", line ...
Python25.png (19.45 KB, 下载次数: 294)
catherinemic 发表于 2016-1-23 12:08
这里大概明白了,谢谢crossin老师~
那为什么在访问dict的时候,只用写result['weather'],而不用result呢 ...
王大锤 发表于 2016-3-4 12:57
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/hammer/Desktop/try.py
...
王大锤 发表于 2016-3-4 12:57
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/hammer/Desktop/try.py
...
vincent1456 发表于 2016-3-5 10:06
Traceback (most recent call last):
File "C:%users\admin\py实验\weather\weather.py", line 16, in
...
摘取字典的字段.png (89.76 KB, 下载次数: 222)
异常判断.png (110.01 KB, 下载次数: 216)
异常判断1.png (19.15 KB, 下载次数: 218)
查询失败.png (97.72 KB, 下载次数: 217)
chchch0720 发表于 2017-9-22 09:15
Traceback (most recent call last):
File "C:\Python27\Crossin\44weather.py", line 18, in
res ...
1.png (11.67 KB, 下载次数: 207)
2.png (14.49 KB, 下载次数: 212)
3.png (10 KB, 下载次数: 213)
asphodelus 发表于 2017-11-2 12:29
py3似乎不少用法都和py2不一样了,raw_input,urllib等等
为了测试方便,去掉了try except添加打印content
...
bobo0769 发表于 2017-11-23 08:26
# -*- coding: utf-8 -*-
from urllib.request import urlopen #打开网页函数
import urllib
微信图片_20180102233445.png (42.78 KB, 下载次数: 211)
1514907325(1).jpg (23.32 KB, 下载次数: 212)
欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/) | Powered by Discuz! X2.5 |