PyDocs

Nav

File and Directory Access

PurePath.is_absolute

pathlib

method of PurePath (source)
  • PurePath.is_absolute()
True if the path is absolute (has both a root and, if applicable,
a drive).
1 Example
>>> PurePosixPath('/a/b').is_absolute()
True
>>> PurePosixPath('a/b').is_absolute()
False

>>> PureWindowsPath('c:/a/b').is_absolute()
True
>>> PureWindowsPath('/a/b').is_absolute()
False
>>> PureWindowsPath('c:').is_absolute()
False
>>> PureWindowsPath('//some/share').is_absolute()
True
from the Python docs
See Also
No see-alsos for pathlib/PurePath.is_absolute
0 Notes
No notes for PurePath.is_absolute