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

 

posted @ 2017-12-11 19:05  Earendil  阅读(192)  评论(0编辑  收藏  举报