libb.expandabspath
- expandabspath(p)[source]
Expand path to absolute path with environment variables and user expansion.
- Parameters:
p (str) – Path string to expand.
- Returns:
Absolute path with all expansions applied.
- Return type:
Path
Example:
>>> import os >>> os.environ['SPAM'] = 'eggs' >>> assert expandabspath('~/$SPAM') == Path(os.path.expanduser('~/eggs')) >>> assert expandabspath('/foo') == Path('/foo')