question about endswith()
Grant Edwards
invalid at invalid.invalid
Thu Mar 3 18:50:44 EST 2011
On 2011-03-03, Matt Funk <mafunk at nmsu.edu> wrote:
> i have a list of files, some of which end with .hdf and one of them end
> with hdf5. I want to filter the hdf5 file. Thereforei set extensions: hdf5
> I try to filter as below:
> if (any(filename.endswith(x) for x in extensions)):
>
> The problem is that i let's all files though rather than just the hdf5
> file. Is there anything i am doing wrong?
Yes, you are doing something wrong.
But, in order for somebody to tell you what you're doing wrong, you'll
have to post some actual, runnable code and tell us 1) what you
expect it to do, 2) what you see it do.
IMPORTANT: Do _not_ retype code, input or output into your posting.
Cut/paste both code and input/output into your posting.
--
Grant Edwards grant.b.edwards Yow! How's it going in
at those MODULAR LOVE UNITS??
gmail.com
More information about the Python-list
mailing list