5. Reading Between the Lines - I think this might be a bug


#1



It tels me to refresh the page because it didn't find the file text.txt. I refresh it but the same problem occurs again.


Here's the lesson:
https://www.codecademy.com/en/courses/python-intermediate-en-OGNHh/1/1?curriculum_id=4f89dab3d788890003000096#


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

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

my_file.close()


Account Broken? Code editor not loading on any module
#2

HI, I'm having the same problem, too.
Entered the same code and getting the same error message.

Hopefully this can be fixed !
Kind Regards,
Bjorn


#3

Same problem here!!!


Whats going wrong here
#4

This worked for me:


#5

Nicely done! This works great and gives more practice writing to files anyway :wink:


#6

Having same problem here. Thought I was seeing things :wink:

Thanks for help!


#7

It was solved. Just add a 4th line in the text.txt file


#8

This works, but you need to make sure you refresh the page first, then add the 4th line then run the code.

Hope they fix this though...


#9

This worked for me:

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

print my_file.readline() * 3

my_file.close()


Bug on 5. Reading Between the Lines?
#10

I know this is solved however if you just remove the ! mark of the first line in text.txt it also solves the problem without having to add a line :slight_smile:


#11

Hi,
thanks That solved the problem.
but did not get how will removing ! solve the problem


#12

I'm having the same problem. Cannot finish the Python course because of this.


#13

editing the file causes it ro be saved which creates the file,

make any small modification then change it back again


#14

Worked for me. Thanks boss!


#15

I do not understand how this was input into the terminal. Is this the only code? A new line? also it ends with an elipses, was there more that got cut off? This section of the course seems very broken


#16

Just simply remove the "!" at the end of the first line of the text.txt file. It will work.


#17

Same here, by just removing the ! the problem was gone


#18

yes worked for me too, reporting this as a bug inside the lesson...


#19

love it! worked for me too. great solution.


#20

Removing the "!" from the first sentence in the text.txt work for me as well. What an exercise in frustration that was!