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

ntpath.commonpath

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


Import

import ntpath
from ntpath import commonpath

Signature & Overview

ntpath.commonpath(paths)

Given an iterable of path names, returns the longest common sub-path.

Usage

import ntpath

assert ntpath.commonpath([r'C:\a\b', r'C:\a\c']) == r'C:\a'

Gotchas

REPL Inspect

from ntpath import commonpath
help(commonpath)

Linked from

Related notes