Got that working now, thanks. <br><br>I've been using activepythons release, and they dont have 2.5 prepared yet. Guess I should just upgrade without them?<br><br><div><span class="gmail_quote">On 10/14/06, <b class="gmail_sendername">
Kent Johnson</b> <<a href="mailto:kent37@tds.net">kent37@tds.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Chris Hengge wrote:
<br>> Oops.... I get an error using that code..<br>><br>> if filename.endswith('.cap','.fru','.hex') or<br>> filename.endswith('.sdr', '.cfg'):<br>> TypeError: slice indices must be integers or None<br>
<br>With Python 2.5 you can do this with a tuple argument. You need an extra<br>set of parentheses to create the tuple:<br>if filename.endswith(('.cap','.fru','.hex', '.sdr', '.cfg')):<br><br>In Python 2.4 or less you need a separate endswith() for each ending.
<br><br>Kent<br><br>_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor
</a><br></blockquote></div><br>