Checking for EOF in stream

Jon Ribbens jon+usenet at unequivocal.co.uk
Mon Feb 19 22:30:26 EST 2007


In article <mailman.4219.1171936242.32031.python-list at python.org>, Gabriel Genellina wrote:
> So this is the way to check for EOF. If you don't like how it was spelled,  
> try this:
> 
>    if data=="": break

How about:

  if not data: break

? ;-)



More information about the Python-list mailing list