Can't overwrite file on windows in Python 2.7
Whenever I try to overwrite a file in Python 2.7 this is what happens, code:
a = open('hello.txt')
a.write('my name is mark')
And my error is:
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
No comments:
Post a Comment