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

But why ? I don’t get it, what does the ! have to do with anything ?

It’s not working for me. It sends this message:

Traceback (most recent call last):
File “python”, line 4, in
ValueError: I/O operation on closed file

You need to write on a few lines in the text.txt file :slight_smile:

2 Likes

All you have to do is go into whatever file is being edited and click save and submit before your submit your own code. I assume this will be fixed in the new update and there might be new content that goes over some of the steps you’d take when using a real python interpreter with other files.
edit: just found out that you also need to type something in and delete it as well. I just wrote this for anyone who tried that but still had problems.

Issue will be solved by adding something in the fourth line of text.txt file.

This worked for me. However this problem has been broken for months.

#RocketScience

great. that solved the problem. But i don’t know how it works

I had this problem, but now my ENTIRE account is broken. I can’t use any module in codecademy. no code editor in any module finishes loading. not just in python. i mean anything.

Rather sad that this still happens after a month. Thanks.

1 Like

Yeah this is ridiculous, it took me about twenty tries to even just follow these instructions. Developers are most likely finishing up the new python courses though instead of fixing the old ones when they are about to release the improved versions.

1 Like

I tried 4th line etc, didn’t work but gave a hint. If you print without calling, it works ok. :wink:

1 Like

Yup, deleting the ! at the end of the first line in text.txt fixed the bug for me. Cheers

I wrote this code. and you have to run it from the script tab

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

for i in range(3):
    print my_file.readline()

my_file.close()

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