os.path.commonpath(paths)
Return the longest common sub-path of each pathname in the sequence paths. Raise ValueError if paths contains both absolute and relative pathnames, or if paths is empty. Unlike commonprefix()
, this returns a valid path.
Availability: Unix, Windows
New in version 3.5.
Please login to continue.