python: file open modes: r, r+, w, w+, a, a+, and that tedious 'b'

From stackoverflow:

首先是最基本的6种模式:

    [1]: http://stackoverflow.com/questions/1466000/python-open-built-in-function-difference-between-modes-a-a-w-w-and-r

 

可以看到,在 r, w, a 后面加个 + 就代表可读可写了。

 

在这六种模式中又可以加上一个 b 代表binary mode:

     [2]: http://stackoverflow.com/questions/9644110/difference-between-parsing-a-text-file-in-r-and-rb-mode

 

 

 

Not so comfortable with that 'b' though

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

:)

posted @ 2016-07-22 14:27  walkerlala  阅读(511)  评论(0编辑  收藏  举报