Oops, try again. Did you create a variable called my_file?


#1




Oops, try again. Did you create a variable called my_file?

Traceback (most recent call last):
File "python", line 2, in
IOError: [Errno 2] No such file or directory: 'output.txt'


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

print myfile.read()

my_file.close()


#2

This can happen if a session times out between lessons, especially if resuming. I find it is simplest to just go back to the start and work through each lesson again, and when you get back to this one everything will be in place.

There are alternatives, though.

If you have an output.txt tab showing, Just add a few lines of plain text to it. No quotes, just lines of text. Any text will do.

Now you should be able to go back to the lesson editor and submit.

If the tab does not exist, then create the file, write to it, close it, and then submit.


#3

I have the same problem. I tried MTF's solution but it's not working. I'm stucked.


#4

I've added a line to blabla.txt and save&run. it worked, thanks!


#5

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