real_rel_path
real_rel_path#
- real_rel_path(path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], start: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path]) Union[cloudpathlib.cloudpath.CloudPath, pathlib.Path] [source]#
Gives the real relative path from a starting folder. (and not just adding
../..
between the start and the target)>>> path = r'D:/_SERTIT_UTILS/sertit-utils/sertit' >>> start = os.path.join(".", "..", "..") >>> real_rel_path(path, start) 'sertit-utils/sertit'