while (assignment):

Hannu Kankaanpää hanzspam at yahoo.com.au
Tue Jul 29 19:01:59 EDT 2003


Sybren Stuvel <sybrenUSE at YOURthirdtower.imagination.com> wrote in message news:<slrnbicopb.6gh.sybrenUSE at sybren.thirdtower.com>...
> while info = mydbcursor.fetchone():
> 	print "Information: "+str(info)

Typically this is done by breaking out of the loop:

while True:
    info = mydbcursor.fetchone()
    if not info:
        break
    print "Information: "+str(info)

(at least as far as I know)




More information about the Python-list mailing list