On this page
posixpath.isabs
Prev: posixpath.getsize | Up: posixpath | Next: posixpath.isdevdrive
Rel: posixpath.abspath, posixpath.basename, posixpath.commonpath, posixpath.commonprefix
Ref: docs.python.org — posixpath.isabs
Tags: #public #python3 #stdlib #posixpath
Import
import posixpath
from posixpath import isabs
Signature & Overview
posixpath.isabs(s)
Test whether a path is absolute
Usage
import posixpath
assert posixpath.isabs('/etc/hosts') is True
assert posixpath.isabs('rel/path') is False
Gotchas
- True iff the path begins with
'/'.
REPL Inspect
from posixpath import isabs
help(isabs)
Linked from
Related notes
- tuts/python3/stdlib_module/posixpath/getsize Linked here; links to this page; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/isdevdrive Linked here; links to this page; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posixpath/abspath Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/basename Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/commonpath Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/commonprefix Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/dirname shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/exists shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/expanduser shared tags: #posixpath, #stdlib