Bug in Reading Between the Lines


I think there is a bug in "Reading Between the Lines". The text.txt file is not loading and run keep repeating "Reading Between the Lines". I have refreshed like 100 times but it happens every time


I get the same thing. I'm not sure how to get past it. I've tried both chrome and firefox. Refreshing didn't help nor did clearing my cache.


@hunveesy, @abhishekkumar1,

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

you are trying to open an existing file.....in read modus.....
If you use following code
you will see which files are available....
and will create the text.txt

import os
print "==show us the existing files =="
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
    print str(f)

print "== if the file doesn't exist, create one =="
if os.path.exists('text.txt'):
    print "File exists"
    print "Creating the text.txt-file"
    my_file = open("text.txt", 'w')
    my_file.write("I'm the first line of the file!" +"\n")
    my_file.write("I'm the second line."+"\n")
    my_file.write("Third line here, boss."+"\n")

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

== discussions / opinions ==


@leonhard.wettengmx.n Thanks for the additional input.

The tutorial shows a text.txt tab with lines of text there, but for some reason it ends up not findable by the main script tab that runs the code:
with open('text.txt', 'r') as blah:

A workaround was to go into the text.txt tab and make a change.
I just added a fourth line to the text.txt file and then ran the code.
This seemed to get it to play nice, although my fourth line didn't actually print, it got me through the exercise.


Thanks for the heads-up! I simply went to the text.txt tab and added a few spaces after the third line, and managed to pass this question.


+1 It helped me as well


Hunveesy, thank you... didn't think of that, but it got me through the exercise +1


I was having the same problem. Not sure why they haven't fixed the bug. But use the link in this former post instead for that problem and it should work:


Thank you! you are the man! :sunglasses:


Thanks a lot! You have gave me a big hand!