getDirs#

pyCGM2.Utils.files.getDirs(folderPath: str, contain: str | None = None, pattern: str | None = None)#

Get all subdirectories within a folder.

Parameters:
  • folderPath (str) – The folder path to search for subdirectories.

  • contain (str, optional) – If specified, only subdirectories containing this string will be returned. Defaults to None.

  • pattern (str, optional) – If specified, only subdirectories matching this regex pattern will be returned. Defaults to None.

Example:getDirs(“C:Data", contain=”Session”, pattern= r”Session [0-9]+”)

Returns:

List[str] – A list of subdirectory names.