file 操作的一些记录

来源:互联网 发布:淘宝预定能退款吗 编辑:程序博客网 时间:2024/05/30 23:22
 r              open text file for reading w              truncate to zero length or create text file for writing wx             create text file for writing a              append; open or create text file for writing at end-of-file rb             open binary file for reading wb             truncate to zero length or create binary file for writing wbx            create binary file for writing ab             append; open or create binary file for writing at end-of-file r+             open text file for update (reading and writing) w+             truncate to zero length or create text file for update w+x            create text file for update a+             append; open or create text file for update, writing at end-of-file r+b  or rb+    open binary file for update (reading and writing) w+b  or wb+    truncate to zero length or create binary file for update w+bx or wb+x   create binary file for update a+b  or ab+    append; open or create binary file for update, writing at end-of-file
0 0
原创粉丝点击