def read_text():
quotes = oepn("C:\Python27\houston.txt")
contents_of)file = quotes.read()
print(contents_of_file)
quotes.close()
read_text()
The code above is well working in my shell I guess you can run it too. ("C:\Python27\houston.txt") is the place where txt stored, and it tells this.... -- Houston, we have a problem. (Apollo 13)
-- Mama always said, life is like a box of chocolates. You never know what you are going to get. (Forrest Gump)
-- You cant handle the truth. (A Few Good Men)
-- I believe everything and I believe nothing. (A Shot in the Dark)
whatever, I just give it little difference in my code, but it doesn't work.
I don't know why ;;; check this plz
quotes = open("C:\Python27\houston.txt")
contents_of_file = quotes.read()
print(quotes.read())
quotes.close()
see... I only replace contents_of_file with quotes.read() but it doesn't work. can you tell me why??? why this happen?