pyiqa.utils.misc¶
Module Contents¶
- pyiqa.utils.misc.mkdir_and_rename(path)[source]¶
mkdirs. If path exists, rename it with timestamp, create a new one, and move it to archive folder.
- Parameters:
path (str) – Folder path.
- pyiqa.utils.misc.scandir(dir_path, suffix=None, recursive=False, full_path=False)[source]¶
Scan a directory to find the interested files.
- Parameters:
dir_path (str) – Path of the directory.
suffix (str | tuple(str), optional) – File suffix that we are interested in. Default: None.
recursive (bool, optional) – If set to True, recursively scan the directory. Default: False.
full_path (bool, optional) – If set to True, include the dir_path. Default: False.
- Returns:
A generator for all the interested files with relative paths.