pyCGM_Single.pyCGM.make_sure_path_exists¶
-
pyCGM_Single.pyCGM.
make_sure_path_exists
(path)¶ Creates a file path.
- Parameters
- pathstr
String of the full file path of the directory to be created.
- Raises
- Exception
Raised if the path was unable to be created for any reason other than the directory already existing.
Examples
>>> import os >>> from shutil import rmtree >>> import tempfile >>> tmpdirName = tempfile.mkdtemp() >>> newDirectory = os.path.join(tmpdirName, 'newDirectory') >>> make_sure_path_exists(newDirectory) >>> os.path.isdir(newDirectory) True >>> rmtree(tmpdirName)