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


#1

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.


#2

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


#3

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.


#4

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.


#5

Same story. It works


#6

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


#7

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


#8

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


#9

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


#10

The solution from this thread solved my problem:


#11

Good.. I hope u can pass now


#12

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
#13

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.close()

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


#14

Thanks, this works for me too. :slight_smile:


#15

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?


#16

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


#17

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


#18

This worked for me - thanks


#19