On this page
posixpath.splitdrive
Prev: posixpath.split | Up: posixpath | Next: posixpath.splitext
Rel: posixpath.abspath, posixpath.basename, posixpath.commonpath, posixpath.commonprefix
Ref: docs.python.org — posixpath.splitdrive
Tags: #public #python3 #stdlib #posixpath
Import
import posixpath
from posixpath import splitdrive
Signature & Overview
posixpath.splitdrive(p)
Split a pathname into drive and path. On Posix, drive is always empty.
Usage
import posixpath
assert posixpath.splitdrive('/a/b') == ('', '/a/b')
Gotchas
- Always returns
('', path)on POSIX (no drive letters).
REPL Inspect
from posixpath import splitdrive
help(splitdrive)
Linked from
Related notes
- tuts/python3/stdlib_module/posixpath/split Linked here; links to this page; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/splitext 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