do...while loops

Issac Trotts trotts at mit.edu
Tue Feb 6 06:48:27 CET 2001


How about this: 

file = open(...)
while(1): 
    line = file.readline()
    if(line == ""): break

-Issac

Dan Parisien (dan at eevolved.com) wrote:

> why don't do...while loops exist in python? Is there are better way to get 
> to that functionality?
> 
> e.g.
> file = open(...)
> do:
>         line = file.readline()
> while line != ""
> 
> 
> Do I have to write a PEP or read some more documentation? ;-)
> 
> Thanks,
> Dan
> -- 
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list