In the 5th exercise of Unit 12 of Python is requested to open a file named text.txt and use the method readline() three times.
But when I execute my code (even with the open() sentence only) I got the following message:
Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'
my_file = open("text.txt","r") print my_file.readline() print my_file.readline() print my_file.readline() my_file.close()
I've got a similar problem in the 6th exercise of Unit 12 of Python.
Does anyone know what the problem is and what can I do to fix it?