I keep getting the error message:
Traceback (most recent call last):
File "python", line 2, in
IOError: File not open for writing
I don't know what I am doing wrong here.
with open("text.txt", "r") as textfile: textfile.write("hello") if textfile.closed == False: textfile.close() print textfile.closed