I don't pass the step in File I/O


#1

It writes me: "No such file or directory text.txt"


#2

its .read() not .readline()


#3

in the instruction say use readline. no problemp but you refresh that page then remove + from r+, after these test again


#4

On other lesson it doesn't work: No such...


#5

oh yes :smiley: this lesson have bug, i use this code:

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

first append to that file if not exist create it first then open that for read, then readlines such as asks:

On three separate lines, print out the result of calling my_file.readline(). See how it gets the next line each time?