I have a text file that contains several lines and i want to print each line. From what i know, this code should work:
file = open("text.txt", "r")
lines = file.readlines()
for line in lines:
print line
file.close()
But it doesn't, and it gives me a syntax error.. Does anybody know why? I tried using both IDLE and Eclipse(PyDev) and it didn't work in both. My version of python is 3.4 Thanks!