Sorry, but I'm gonna need you to refresh the page


#1



File input / output - Read Between the Lines


Hi,

I get the error message:
Oops, try again. Sorry, but I'm gonna need you to refresh the page! Don't worry your code is saved.

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


Refreshing the page doesn't help.
neither reopening my browser.

please help!!


my_file = open("text.txt", "r")
print my_file.readline()
print my_file.readline()
print my_file.readline()

my_file.close()


#2

Write in the text.txt file and your code should work :slight_smile:


#3

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