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

ntpath.dirname

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


Import

import ntpath
from ntpath import dirname

Signature & Overview

ntpath.dirname(p)

Returns the directory component of a pathname

Usage

import ntpath

assert ntpath.dirname(r'C:\Users\Ada\doc.txt') == r'C:\Users\Ada'

Gotchas

REPL Inspect

from ntpath import dirname
help(dirname)

Linked from

Related notes