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

ntpath.commonprefix

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


Import

import ntpath
from ntpath import commonprefix

Signature & Overview

ntpath.commonprefix(m)

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

Usage

import ntpath

assert ntpath.commonprefix([r'C:\app', r'C:\apt']) == r'C:\ap'

Gotchas

REPL Inspect

from ntpath import commonprefix
help(commonprefix)

Linked from

Related notes