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 - [email protected]
http://mail.python.org/mailman/listinfo/tutor