Bug on 5. Reading Between the Lines?


#1



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

It keeps saying to refresh the page!! I refreshed it many times and it doesn't work, Plz help!!


Bug in Python course - IO LESSON 5
#2

This seems to be a huge problem that needs to be fixed by codecademy, but they're currently working on a new Python course so they can't always fix things in the old one that they're getting rid of.


Here's a link to people discussing trouble with this exercise.

Essentially, what you need to do is just change text.txt and do something simple like write a new line, refresh, get rid of it, and then submit the code again and it should work. I hope that I helped. :smile: I know that it's really frustrating. But congrats! You're so close to being done with Python!!!


Reading
#3

Once a session times out, the best thing to do with this module is start from lesson 1 and proceed from there.


#4


Found it! Just delete the ! in the text.txt


#5

This worked for me too! Just open the text.txt tab and delete the "!" at the end of line 1 and send you code again, and it works!


#6

I deleted the "!" and then added it back in and that also worked. I'm guessing that just the act of editing the file some how makes it work.


#7

It worked, thanks bro.


#8

this works also

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

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

#9