If we consider
f=open('foo.txt')
x= f.readline()
print x
Then we get the first line of file foo.txt.
Now consider:
<code>
f=open('foo.txt')
while (x = f.readline()) != '': # Read one line till EOF and do something
.... do something
f.close()
</code>
This gives a syntax error at
x=f.readline().
I am relatively new to Python and I cannot figure out the problem. One encounters this kind of expression often in C.
Thanks in advance