I've been using activepythons release, and they dont have 2.5 prepared yet. Guess I should just upgrade without them?
On 10/14/06,
Kent Johnson <[EMAIL PROTECTED]> wrote:
Chris Hengge wrote:
> Oops.... I get an error using that code..
>
> if filename.endswith('.cap','.fru','.hex') or
> filename.endswith('.sdr', '.cfg'):
> TypeError: slice indices must be integers or None
With Python 2.5 you can do this with a tuple argument. You need an extra
set of parentheses to create the tuple:
if filename.endswith(('.cap','.fru','.hex', '.sdr', '.cfg')):
In Python 2.4 or less you need a separate endswith() for each ending.
Kent
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor