[wxPython-users] Application Breaks Using Python-2.5 -- FIXED

Chris Mellon arkanes at gmail.com
Mon Nov 12 15:40:54 PST 2007


On Nov 12, 2007 5:31 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> On Mon, 12 Nov 2007, Chris Mellon wrote:
>
> > I'm not sure why this would be working anywhere else, but len(range(0,
> > 34)) is 34, not 33.
>
> Chris,
>
>    I was puzzled, too, since that did not see correct to me, but it was
> working just fine yesterday on my desktop workstation with the older
> python/wxPython. That's why I assumed range stopped at n-1.
>
>    Regardless, changing the 34 to 33 fixed that problem.
>

range, as with most other python indexing (like slicing) goes from
start to end-1 inclusive.
So range(10) generates [0,1,2,3,4,5,6,78,9] - a total of 10 values.

> > By the way, the 0 is not neccassary, range defaults to starting from 0.
>
>    Ah, yes.
>
> Many thanks,
>
> Rich
>
> --
> Richard B. Shepard, Ph.D.               |  Integrity            Credibility
> Applied Ecosystem Services, Inc.        |            Innovation
> <http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>




More information about the wxpython-users mailing list