2024-04-25 16:49:25 发布
网友
每当我试图覆盖Python 2.7中的一个文件时,会发生这样的情况,代码:
a = open('hello.txt') a.write('my name is mark')
我的错误是:
来自^{}上的文档:
If mode is omitted, it defaults to 'r'.
以写代替使用
a = open('hello.txt', 'w')
或者更好
来自^{} 上的文档:
以写代替使用
或者更好
^{pr2}$相关问题 更多 >
编程相关推荐