标签:close 主页 decode urllib2 http example utf8 python3 pre
python3中urllib2被整合成了url.request和url.error了
example1:
获取pythonorg主页
import urllib.request
result = urllib.request.urlopen("http://www.python.org")
respone = result.read()
respone = respone.decode("utf8")
result.close()
print(respone)
标签:close 主页 decode urllib2 http example utf8 python3 pre
原文地址:http://www.cnblogs.com/luobobusy/p/6848717.html