5th Reading Between The Lines


#1



https://www.codecademy.com/courses/python-intermediate-en-OGNHh/1/1?curriculum_id=4f89dab3d788890003000096


When I submitted my code, this is what appeared in the console:
Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'

And this is what the other error message thingy said:
Sorry, but I'm gonna need you to refresh the page! Don't worry your code is saved.

I reloaded the page and tried again, but the same thing happened again. I kept trying upwards of 10 times to no avail.


I would've expected it to be fixed after I reloaded the page once.


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

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


#2

I remember having this issue too.
Go to your text.txt tab, backspace the last period and add it again. Then click Save&Submit Code. Idk why but sometimes Codecademy needs a reminder that text.txt exists :confused:


#3

Thank you, I had it right as well but that fixed it for me.


#4

Thank you datfatcat, I had that exact same issue too and that fixed it for me!


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.