Cannot found the text.txt on the codecademy's database


Hi everyone,
Please see the picture above. I have a problem with the reading file, I do not understand what's wrong with my code.


your code is completely fine, you should do what the error message says: reload the page. And use a different browser if you still have problems


I'm currently experiencing exactly the same problem using Google Chrome. There are no errors in the Developer Console, and in the network tab I see that the server response is an empty JSON object ({}).

I seriously doubt it could be related to a browser version, seems more like a server-side environment bug to me.

Further tasks result in the same Python interpreter error, too, although they're marked green.


Thanks for your answer. I tested my code on local and it run correctly. And I create a file with the same name and then Re-submit the code and it passed.


Same story. It works


I can't get past this point. Tried re-loading the page a bunch of times. Tried different browsers. Still stuck.


try logging out and logging back in, or restarting your computer


Tried logging in and out and restarting computer. Still stuck.


Hmm. Is it possible you could use a different computer?


The solution from this thread solved my problem:


Good.. I hope u can pass now


I made a work around as it wasn't working for me either, first, I copied the content of the text.txt file (you can open the file through the tabs on the editor), then I wrote the copied content to a new file with the name "text.txt", after that I did what was required in the exercise.

Why this works, because the write instruction actually creates a new file if it didn't find it in the directory.

# Writing in the file
my_file= open("text.txt", "w")
my_file.write("I'm the first line of the file!\nI'm the second line.\nThird line here, boss.")

Then remove these lines and do the exercise normally.

Reading Between the Lines

Thanks, it helps a lot! For me, it works also this way, without removing the lines.

my_file = open("text.txt", "r+")
my_file.write("I'm the first line of the file!\nI'm the second line.\nThird line here, boss.")

my_file = open("text.txt", "r")
print my_file.readline()
print my_file.readline()
print my_file.readline()


Thanks, this works for me too. :slight_smile:


I have tried all of the solutions as well as trying the code in three different browsers and it still does not work. Is there anything else I can do to proceed from this point?


Here's a work around I found in search of in answer to this:


For me, it looks like, adding an extra "enter" or maybe any change in file was enough...


This worked for me - thanks