beginner, idiomatic python

Paul Rubin http
Mon Aug 27 15:27:26 EDT 2007


Neil Cerutti <horpner at yahoo.com> writes:
> i = 0
> while i < self.parent.GetPageCount():
>   # do stuff
>   i += 1

Alternatively:

    from itertools import count

    for i in count():
       if i >= self.parent.GetPageCount():
          break
      ...



More information about the Python-list mailing list