list_files_in_directory

compas_fab.utilities.list_files_in_directory(directory, fullpath=False, extensions=[])[source]

This function lists just the files in a directory, not sub-directories.

Parameters
  • directory (str) – the directory to search for files.

  • fullpath (bool, optional) – specifies if the returned list of strings is with the full path. Defaults to False.

  • extensions (list of str, optional) – a list of allowed extensions, e.g. [“jpg”, “png”] if you just want to list images. Defaults to empty list.

Returns

files (list of str) –

A list of files as string if files

exist, or empty list.