from pathlib import Path# List of subdirectory namessubdirs = ['pcfn','cfn','cf','n','rmv','n_rmv','inp','n_inp']# Base pathbase_path =Path(f'./fit_res/sm/{sim_mode}')# Create directoriesfor subdir in subdirs: (base_path / subdir).mkdir(exist_ok=True, parents=True)