Answer the question
In order to leave comments, you need to log in
Why can't read from file - io.UnsupportedOperation: not readable?
I wrote a simple code in Notepad++ in Python. Launched on this video. Here is the code:
f=open('text.txt','w')
f.write("adc")
f.read()
After running, I got this message:
Traceback (most recent call last):
File "C:\ Users\ZERO\Desktop\Programming\new1.py", line 3, in
f.read()
io.UnsupportedOperation: not readable
So gentlemen, what's the problem?
Answer the question
In order to leave comments, you need to log in
How many accolades.
You yourself opened the file for writing, and then you want to read it. Do not do it this way.
Is it okay that you opened the file for writing and are trying to read from it? Python says so, read the errors, after all
Clearly, thanks, I just met Python`om yesterday. So, sorry for the stupid question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question