Always receiving "Oops, try again. Sorry, but I'm gonna need you to refresh the page! Don't worry your code is saved." error


#1

Im always receiving the below error "

Oops, try again.
Sorry, but I'm gonna need you to refresh the page! Don't worry your code is saved.

"

Note: I have refreshed the page and tried logged in and out.Cleared browser cache .Nothing worked out :frowning: .
I'm not able to move further. Attached the screenshot for reference



#2

go ahead and look at this old post of mine, you should find your solution here.


#3

I was suffering the same disaster. Maybe the file 'text.txt' really does not exist. So, I created a 'text.txt' file before the program, and it worked.

string="""I'm the first line of the file!
I'm the second line.
Third line here, boss."""
my_file = open('text.txt', "w")
my_file.write(string)
my_file.close()

my_file = open('text.txt', "r")

print my_file.readline()
print my_file.readline()
print my_file.readline()

my_file.close()


#4

I'm not sure about it not really existing, because on the top of the editor you can see your script.py tab and a text.txt tab, so it would only make sense that it really does exist.

the conclusion myself and others came to before was that it's just some weird interference with codecademy not wanting to recognize the file.


#5

In your code, on the first line, shouldn't it say "text.txt" ?


#6

Just go to text.txt tab, and delete everything written there. Just add 3 random lines. Come back to script.py tab and run the Save & Submit. Voila, It works.


#7

The best solution so far. Thanks.


#8

This isnt working for me. Tried everything in this thread and get various errors. Not sure how to report the issue to CA


#9

Good job figuring that out! I spent far too much time on that one! Thank you very much!!


#10

Did you read through my post?


#11

What is the error are you getting now. You first need to ensure your code is working and the only error is as mentioned in the thread heading. After that you just need to ensure you delete and reenter the text. And again come back to script.py tab and run save and submit.


#12

I had the same problem. shallfeelyoung is right. From the compiler error displayed in the console, (note: the compiler error, not the Codecademy dialog box) either the file truly doesn't exist or for some reason the program can't find or recognize it. Creating a new text file named "text.txt" did fix it though. Thanks for the common sense, easy fix, shallfeelyoung.


#13

just like malayp said: Just go to text.txt tab, and delete everything written there. Just add 3 random lines. Come back to script.py tab and run the Save & Submit.

worked for me too ... just weird.


#14

Yeah, just go to text.txt then delete it and write three lines of script


#15

Remove the data from text.txt and write three lines again...data could be anything


#16

same here !!!I am stuck there for days


#17

I was stuck on this one too--I can't believe changing the strings in text.txt file works!


#18

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

This should solve it


#19

There are 2 solutions which have worked for me which i feel essentially do the same thing. Either you create a new text.txt file and write your strings into it and then use the readline() function OR just delete the existing strings in the text.txt tab and add some new lines (that's basically creating a new text.txt itself which the compiler can find).


#20

I am getting that error even now and my python teacher said my code is correct just as yours is.