if you could define extension to be a tuple, you could use it this way, which is a little simpler:
extensions = ('hdf5',) #works files = ('MOD03.A2010002.1810.005.2010258062733.hdf','MOD03.A2010002.1950.005.2010258063105.hdf','MOD03.A2010002.1950.005.2010258063105.hdf5') for filename in files: if filename.endswith(extensions) : print filename -- Mauro Cáceres
-- http://mail.python.org/mailman/listinfo/python-list