(data_dir, file_ext)
return file_names
Return list of files with the given extension in the data_dir
Return list of files with the given extension in the data_dir
Return list of files with the given extension in the data_dir
def get_file_list(data_dir, file_ext):
    """
    Return list of files with the given extension in the data_dir
    """
    file_ext = file_ext if isinstance(file_ext, list) else [file_ext]
    file_names = [os.path.join(data_dir, fn) for fn in os.listdir(data_dir)
                  if any(fn.endswith(ext) for ext in file_ext)]

    return file_names
def get_file_list ( data_dir , file_ext ) : file_ext = file_ext if isinstance ( file_ext , list ) else [ file_ext ] file_names = [ os . path . join ( data_dir , fn ) for fn in os . listdir ( data_dir ) if any ( fn . endswith ( ext ) for ext in file_ext ) ] return file_names