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

posixpath.commonprefix

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


Import

import posixpath
from posixpath import commonprefix

Signature & Overview

posixpath.commonprefix(m)

Given a list of pathnames, returns the longest common leading component

Usage

import posixpath

assert posixpath.commonprefix(['/usr/lib', '/usr/local']) == '/usr/l'

Gotchas

REPL Inspect

from posixpath import commonprefix
help(commonprefix)

Linked from

Related notes