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

ntpath.splitroot

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


Import

import ntpath
from ntpath import splitroot

Signature & Overview

ntpath.splitroot(p)

Split a pathname into drive, root and tail.

Usage

import ntpath

if hasattr(ntpath, 'splitroot'):
    assert ntpath.splitroot(r'C:\Users\Ada') == ('C:', '\\', r'Users\Ada')

Gotchas

REPL Inspect

from ntpath import splitroot
help(splitroot)

Linked from

Related notes