502 Bad Gateway


#1

my_file = open("text.txt", "w")
my_file.write("first")
my_file.write("\n")
my_file.write("first")
my_file.write("\n")
my_file.write("first")
my_file.write("\n")
my_file = open("text.txt", "r")
print my_file.readline()
print my_file.readline()
print my_file.readline()
my_file.close()

It keeps saying "text.txt" file/directory does not exist and asking you to refresh the page. Clicking on the Q&A button, I get "502 Bad Gateway". Anyone see the same problem? Using the code above, I jumped out of the circle.


#2

This is for the "Reading Between the Lines" exercise


#3

Woah! I am quite surprised you had that issue and you had to do all this.

Following the instruction and doing this, got it done. :slight_smile:

with open("text.txt", "w") as textfile:
	textfile.write("Success!")


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

#4

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