理解posixpath.py in Python

  • 缘起

    (20201024Solved)vsCode debug出现no such file or directory:’/home/user/.local/lib’》提到python在进行debug文件时会首先调用posixpath.py

  • posixpath.py

    路径为home/user/anaconda3/lib/python3.8/posixpath.py

    posixpath.py代码一开始就说了,这是Common operations on Posix pathnames, Instead of importing this module directly, import os and refer to this module as os.path. The ‘os.path’ name is an alias for this module on Posix systems; on other systems (e.g. Windows), os.path provides the same operations in a manner specific to that platform, and is an alias to another module(e.g. ntpath).

    关于《什么是POSIX system

    我们去看os.path模块,其source code正是Lib/posixpath.py (for POSIX) and Lib/ntpath.py(for Windows NT).

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/109277030
今日推荐