fix: correctly create directory for path_outputs if not existing (#1668)

* correctly create directory for outputs if not existing

* feat: add make_directory parameter checks for list, extract make_directory to util
This commit is contained in:
Manuel Schmid
2024-02-25 18:41:43 +01:00
committed by GitHub
parent 9c19300a3e
commit b5f019fb62
2 changed files with 37 additions and 25 deletions
+7
View File
@@ -188,3 +188,10 @@ def get_file_from_folder_list(name, folders):
def ordinal_suffix(number: int) -> str:
return 'th' if 10 <= number % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(number % 10, 'th')
def makedirs_with_log(path):
try:
os.makedirs(path, exist_ok=True)
except OSError as error:
print(f'Directory {path} could not be created, reason: {error}')