cd_dat¶
-
pydriosm.utils.cd_dat(*sub_dir, dat_dir='dat', mkdir=False, **kwargs)¶ Change directory to
dat_dirand its sub-directories within a package.- Parameters
sub_dir (str) – name of directory; names of directories (and/or a filename)
dat_dir (str) – name of a directory to store data, defaults to
"dat"mkdir (bool) – whether to create a directory, defaults to
Falsekwargs – optional parameters of os.makedirs, e.g.
mode=0o777
- Returns
an absolute path to a directory (or a file) under
data_dir- Return type
str
Example:
>>> import os >>> from pydriosm.utils import cd_dat >>> path_to_dat = cd_dat() >>> print(os.path.relpath(path_to_dat)) pydriosm\dat