On this page
  1. posixpath.splitroot
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

posixpath.splitroot

Prev: posixpath.splitext | Up: posixpath
Rel: posixpath.abspath, posixpath.basename, posixpath.commonpath, posixpath.commonprefix
Ref: docs.python.org — posixpath.splitroot
Tags: #public #python3 #stdlib #posixpath


Import

import posixpath
from posixpath import splitroot

Signature & Overview

posixpath.splitroot(p)

Split a pathname into drive, root and tail.

Usage

import posixpath

if hasattr(posixpath, 'splitroot'):
    assert posixpath.splitroot('/usr/bin') == ('', '/', 'usr/bin')

Gotchas

REPL Inspect

from posixpath import splitroot
help(splitroot)

Linked from

Related notes