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

posixpath.dirname

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


Import

import posixpath
from posixpath import dirname

Signature & Overview

posixpath.dirname(p)

Returns the directory component of a pathname

Usage

import posixpath

assert posixpath.dirname('/usr/local/bin') == '/usr/local'

Gotchas

REPL Inspect

from posixpath import dirname
help(dirname)

Linked from

Related notes