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

posixpath.relpath

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


Import

import posixpath
from posixpath import relpath

Signature & Overview

posixpath.relpath(path, start=None)

Return a relative version of a path

Usage

import posixpath

assert posixpath.relpath('/a/b/c', '/a') == 'b/c'

Gotchas

REPL Inspect

from posixpath import relpath
help(relpath)

Linked from

Related notes