ValueError: must have exactly one of create/read/write/append mode

Posted 天玑

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ValueError: must have exactly one of create/read/write/append mode相关的知识,希望对你有一定的参考价值。

ValueError: must have exactly one of create/read/write/append mode

 

fo = open(‘runoob.txt‘, ‘rw+‘)

python 中文件打开操作的mode中没有“rw”

合法的mode有:

r、rb、r+、rb+、w、wb、w+、wb+、a、ab、a+、ab+




以上是关于ValueError: must have exactly one of create/read/write/append mode的主要内容,如果未能解决你的问题,请参考以下文章