What is the problem with following code?


txt.x is:
I'm the first line of the file!
I'm the second line.
Third line here, boss.

my code is:

print (my_file.readline())
print (my_file.readline())
print (my_file.readline())

I receive following error:
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'
What is the problem?


Please read
to get some more insight.....


change content of the .txt file
u must keep 3 lines


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