On this page
ntpath.isabs
Prev: ntpath.getsize | Up: ntpath | Next: ntpath.isdevdrive
Rel: ntpath.abspath, ntpath.basename, ntpath.commonpath, ntpath.commonprefix
Ref: docs.python.org — ntpath.isabs
Tags: #public #python3 #stdlib #ntpath
Import
import ntpath
from ntpath import isabs
Signature & Overview
ntpath.isabs(s)
Test whether a path is absolute
Usage
import ntpath
assert ntpath.isabs(r'C:\Windows') is True
assert ntpath.isabs('rel\\path') is False
Gotchas
- Drive-relative paths (
C:foo) are NOT absolute; root-relative (\foo) counts as absolute inntpath.
REPL Inspect
from ntpath import isabs
help(isabs)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/getsize Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/isdevdrive Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ntpath/abspath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/basename Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonpath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonprefix Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/dirname shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/exists shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/expanduser shared tags: #ntpath, #stdlib