How to filter files (with known type) from os.walk? July 28, 2023 by Tarik files = [ fi for fi in files if not fi.endswith(".dat") ]