zoukankan      html  css  js  c++  java
  • 记录python2.7迁移到python3.6过程中的一些代码差异

    python2.7 python 3.6
    import urllib2 import urllib
    import urlparse import urllib
    import exceptions 废弃
    urllib2.urlopen urllib.request.urlopen
    urllib2.Request urllib.request.Request
    urllib.urlencode urllib.parse.quote
    urllib.urldecode urllib.parse.unquote
    dict.has_key(xx) xx in dict
    types.StringType type('')
    types.UnicodeType 废弃
    types.ListType type([])
    types.DictType type({})
    types.IntType type(1)
    types.BooleanType type(True)
    types.LongType type(1)
    types.FloatType type(1.1)
    except Exception,err except Exception as err
    print xxx print(xxx)
  • 相关阅读:
    洛谷
    洛谷
    模板
    模板
    模板
    模板
    模板
    洛谷
    洛谷
    模板
  • 原文地址:https://www.cnblogs.com/ahfuzhang/p/11772485.html
Copyright © 2011-2022 走看看