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

ntpath.splitdrive

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


Import

import ntpath
from ntpath import splitdrive

Signature & Overview

ntpath.splitdrive(p)

Split a pathname into drive/UNC sharepoint and relative path specifiers.

Usage

import ntpath

assert ntpath.splitdrive(r'C:\a\b') == ('C:', r'\a\b')
assert ntpath.splitdrive(r'\\srv\share\f') == (r'\\srv\share', r'\f')

Gotchas

REPL Inspect

from ntpath import splitdrive
help(splitdrive)

Linked from

Related notes