P
Phoe6
Hi all,
I just read the manual and got to know I can use a for loop to iterate
through the lines in the file.
But so far, I was strugling with the following:
import os
file = open('File1.txt','r')
line = file.readline()
while line !=' ':
print line
line = file.readline()
As mentioned in the docs, the EOF returns an empty string. I am unable
to catch or match against the EOF. Please help me in pointing out as
where I am making the mistake.
I just read the manual and got to know I can use a for loop to iterate
through the lines in the file.
But so far, I was strugling with the following:
import os
file = open('File1.txt','r')
line = file.readline()
while line !=' ':
print line
line = file.readline()
As mentioned in the docs, the EOF returns an empty string. I am unable
to catch or match against the EOF. Please help me in pointing out as
where I am making the mistake.