zoukankan      html  css  js  c++  java
  • Python3 urllib 与 Python2 urllib的变化

    Infi-chu:

    http://www.cnblogs.com/Infi-chu/

    Py2.x:

      Urllib

      Urllin2

    Py3.x:

      Urllib

    变化:

    1. 在Pytho2.x中使用import urllib2——-对应的,在Python3.x中会使用import urllib.requesturllib.error
    2. 在Pytho2.x中使用import urllib——-对应的,在Python3.x中会使用import urllib.requesturllib.errorurllib.parse
    3. 在Pytho2.x中使用import urlparse——-对应的,在Python3.x中会使用import urllib.parse
    4. 在Pytho2.x中使用import urlopen——-对应的,在Python3.x中会使用import urllib.request.urlopen
    5. 在Pytho2.x中使用import urlencode——-对应的,在Python3.x中会使用import urllib.parse.urlencode
    6. 在Pytho2.x中使用import urllib.quote——-对应的,在Python3.x中会使用import urllib.request.quote
    7. 在Pytho2.x中使用cookielib.CookieJar——-对应的,在Python3.x中会使用http.CookieJar
    8. 在Pytho2.x中使用urllib2.Request——-对应的,在Python3.x中会使用urllib.request.Request
  • 相关阅读:
    c# 字符串中某个词出现的次数及索引
    c# 冒泡排序
    WCF 高级知识
    Web Api基础知识
    Web Services基础知识
    WCF Demo
    IIS部署WCF常见错误
    IIS部署WCF
    IIS部署WCF错误
    WCF基础知识
  • 原文地址:https://www.cnblogs.com/Infi-chu/p/9628849.html
Copyright © 2011-2022 走看看