python2 with open(path,"",) as f:

mac2022-06-30  22

python2 with open(path,"",) as f:

python2 with open 没有 encoding 这个参数 会报错, 可以 

import io

with io.open(path,"") as f: 这样就ok 或者是读取的时候 加上 encoding 

posted on 2019-04-27 18:33  吃瓜的瓜农 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/guanong/p/10779682.html

相关资源:Pycharm 代码高亮推荐配色
最新回复(0)