python2 与python3的变化

1 写文件如果是bytes类型的话,打开文件 open参数设置为wb

2 python2 默认包import是相对路径,python3是绝对路径

3 python3的dict没有has_key方法,用in

map() in Python 3 is a generator function, which is not serializeable in JSON. You can make it serializeable by converting it to a list

原文地址:https://www.cnblogs.com/earendil/p/8024601.html