zoukankan      html  css  js  c++  java
  • python3与 python2 urllib模块区别

    Py2.x:

    • Urllib
    • Urllin2

    Py3.x:

    • Urllib

    变化:

    • 在Pytho2.x中使用import urllib2——-对应的,在Python3.x中会使用import urllib.requesturllib.error
    • 在Pytho2.x中使用import urllib——-对应的,在Python3.x中会使用import urllib.requesturllib.errorurllib.parse
    • 在Pytho2.x中使用import urlparse——-对应的,在Python3.x中会使用import urllib.parse
    • 在Pytho2.x中使用import urlopen——-对应的,在Python3.x中会使用import urllib.request.urlopen
    • 在Pytho2.x中使用import urlencode——-对应的,在Python3.x中会使用import urllib.parse.urlencode
    • 在Pytho2.x中使用import urllib.quote——-对应的,在Python3.x中会使用import urllib.request.quote
    • 在Pytho2.x中使用cookielib.CookieJar——-对应的,在Python3.x中会使用http.CookieJar
    • 在Pytho2.x中使用urllib2.Request——-对应的,在Python3.x中会使用urllib.request.Request
  • 相关阅读:
    JavaScript 获取来源地址
    JavaScript 调试&显示变量
    JavaScript Math对象
    JavaScript 封闭函数
    常见泛型委托
    使用BindingSource绑定数据库
    Case Reply
    RSS订阅
    ADO.NET
    泛型的优点
  • 原文地址:https://www.cnblogs.com/ghming/p/9195643.html
Copyright © 2011-2022 走看看