How to circumvent the fallacy of Python's os.path.commonprefix?

后端 未结 5 1279
耶瑟儿~
耶瑟儿~ 2020-12-18 19:00

My problem is to find the common path prefix of a given set of files.

Literally I was expecting that \"os.path.commonprefix\" would do just that. Unfortunat

5条回答
  •  孤城傲影
    2020-12-18 19:22

    It seems that this issue has been corrected in recent versions of Python. New in version 3.5 is the function os.path.commonpath(), which returns the common path instead of the common string prefix.

提交回复
热议问题