Work Around for "Reading between the Lines"; text.txt does not exist error

From an old post: Bug? 5/9 (Reading Between the Lines) 'text.txt' file not found

Bug? On File Input/Output part 5/9 (Reading Between the Lines) I get an error like 'text.txt' file not found. The code is my_file = open("text.txt", "r") print my_file.readline() print my_file.readline() print my_file.readline() my_file.close() I don't think there is anything wrong with the code because if I skipped this part and do the 6/9 (PSA: Buffering Data) first the text.txt file will be created and the 5/9 will run just fine.

My Question: Wait, what? "Typing any character or a space on the .txt " Not sure I understand what this means. Are you editing the text.txt file some how? or putting a space in the code? I'm getting the same error and the "helpers" are telling me it is a connectivity issue. Looks like not so much.


I just made the file, it passed me on to the next excercise

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

5. Reading Between the lines

Ay that was the rub. All fixed. Thanks for the advice!@!


Thanks for sharing. Nice help!!!!


If you alter the text.txt file (go to the tab on the top) in any way your answer will be accepted.

Delete a character, or better yet, just add a space in the end of a line and then you can submit your code.


Thanks for the solution, it works great.


thnku this helps alot