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

ntpath.basename

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


Import

import ntpath
from ntpath import basename

Signature & Overview

ntpath.basename(p)

Returns the final component of a pathname

Usage

import ntpath

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

Gotchas

REPL Inspect

from ntpath import basename
help(basename)

Linked from

Related notes