EOF

Matthew Schinckel baron at null.net
Sat Jul 8 00:48:11 EDT 2000


On Fri, 7 Jul 2000, fae wrote:

> 
> Sorry,
>    how can I test if I reached the end of file ?
> 
> thanks ,
>    Leonardo.
> 

That's okay,

How about:

(assuming this somewhere above:)
f = open(filename, 'r')

if f.tell(0,2):
    print "EOF!"

-- 
Matthew Schinckel	<matt at null.net>

ARCHDUKE FERDINAND FOUND ALIVE --
	FIRST WORLD WAR MISTAKE




More information about the Python-list mailing list