每当我尝试在 Python 2.7 中覆盖文件时,都会发生这种情况,代码:
a = open('hello.txt')
a.write('my name is mark')
我的错误是:
Traceback (most recent call last):
File "C:\Users\Mark Malkin\Desktop\New folder\opener.py", line 2, in <module>
a.write('my name is mark')
IOError: File not open for writing