5-8

pyc 直接在setting中安装,用pyc环境运行

urllib和urllib2模块都做与请求URL相关的操作,但他们提供不同的功能。 
urllib2.urlopen accepts an instance of the Request class or a url, (whereas urllib.urlopen only accepts a url 中文意思就是:urllib2.urlopen可以接受一个Request对象或者url,(在接受Request对象时候,并以此可以来设置一个URL的headers),urllib.urlopen只接收一个url 
urllib 有urlencode,urllib2没有,这也是为什么总是urllib,urllib2常会一起使用的原因

猜你喜欢

转载自www.cnblogs.com/coder-2017/p/9010356.html
5-8
今日推荐