错误:import urllib
r = urllib.urlopen(‘http://z.cn/‘)
html = r.read()
print(html)
提示信息:AttributeError: module ‘urllib’ has no attribute ‘urlopen’
解决方法:
用具体的urllib.request模块来调用它
import urllib.request
r = urllib.request.urlopen(‘http://z.cn/‘)
html = r.read()
print(html)
python安装位置查询
import sys
sys.path
IndentationError: expected an indented block
空格缩进问题
783

被折叠的 条评论
为什么被折叠?



