-
记录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) |
-
相关阅读:
nginx-rtmp-module搭建流媒体服务器
rabbitmq安装
opencv+python (3)
linux命令
mysql语句概览
BUUCTF V&N-misc内存取证
2018 HEBTUCTF 部分misc
2020 安恒2月月赛 misc
2018.6.1 铁三数据赛 复现
2020 i春秋新春战疫公益赛 misc
-
原文地址:https://www.cnblogs.com/ahfuzhang/p/11772485.html
Copyright © 2020-2023
润新知