"Fredrik Lundh" <fredrik@[...].com> wrote:> 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'):> ...
That wont match any .TXT files. Whether thats a problem depends on
whether you use Windows or not.....
Toby Dickenson
tdickenson@[...].com
--
http://mail.python.org/mailman/listinfo/python-list