Ralph Corderoy wrote:
> > or, much more preferably:> >> > if filename[-4:] == '.txt':> > Overall, the Perl code's better. It didn't have to hard-code the> length of the string.
if it matters, use endswith instead:
if filename.endswith('.txt'):
...
</F>
--
http://mail.python.org/mailman/listinfo/python-list