码迷,mamicode.com
首页 > 编程语言 > 详细

python2 与python3的变化

时间:2017-12-11 20:00:36      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:body   设置   byte   ict   pos   文件   log   类型   generator   

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

 

python2 与python3的变化

标签:body   设置   byte   ict   pos   文件   log   类型   generator   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!