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

ntpath.relpath

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


Import

import ntpath
from ntpath import relpath

Signature & Overview

ntpath.relpath(path, start=None)

Return a relative version of a path

Usage

import ntpath

assert ntpath.relpath(r'C:\a\b\c', r'C:\a') == r'b\c'

Gotchas

REPL Inspect

from ntpath import relpath
help(relpath)

Linked from

Related notes