do...while

Michael P. Soulier msoulier at nortelnetworks.com_.nospam
Thu Jun 20 12:26:35 EDT 2002


    Greetings.

    How do you people handle the lack of a do...while in Python? I find that
at times, I must initialize variables for a loop with identical code to the
loop, which feels like a waste to me. 

ie.

    line = filehandle.readline()
    while len(line) > 5:
        line = filehandle.readline()

    A do...while here would be nice. 

    Just curious. 

    Mike

-- 
Michael P. Soulier, QX41, SKY  Tel: 613-765-4699 (ESN: 39-54699)
Optical Networks, Nortel Networks, SDE Pegasus
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix



More information about the Python-list mailing list