{
    "mode": "pydoc",
    "parameter": "ntpath",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/ntpath/json",
    "generated": "2026-06-02T15:02:25Z",
    "sections": {
        "NAME": {
            "content": "ntpath - Common pathname manipulations, WindowsNT/95 version.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/ntpath.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Instead of importing this module directly, import os and refer to this\nmodule as os.path.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "abspath = abspathfallback(path)\nReturn the absolute version of a path as a fallback function in case\n`nt.getfullpathname` is not available or raises OSError. See bpo-31047 for\nmore.\n",
            "subsections": [
                {
                    "name": "basename",
                    "content": "Returns the final component of a pathname\n"
                },
                {
                    "name": "commonpath",
                    "content": "Given a sequence of path names, returns the longest common sub-path.\n"
                },
                {
                    "name": "commonprefix",
                    "content": "Given a list of pathnames, returns the longest common leading component\n"
                },
                {
                    "name": "dirname",
                    "content": "Returns the directory component of a pathname\n"
                },
                {
                    "name": "exists",
                    "content": "Test whether a path exists.  Returns False for broken symbolic links\n"
                },
                {
                    "name": "expanduser",
                    "content": "Expand ~ and ~user constructs.\n\nIf user or $HOME is unknown, do nothing.\n"
                },
                {
                    "name": "expandvars",
                    "content": "Expand shell variables of the forms $var, ${var} and %var%.\n\nUnknown variables are left unchanged.\n"
                },
                {
                    "name": "getatime",
                    "content": "Return the last access time of a file, reported by os.stat().\n"
                },
                {
                    "name": "getctime",
                    "content": "Return the metadata change time of a file, reported by os.stat().\n"
                },
                {
                    "name": "getmtime",
                    "content": "Return the last modification time of a file, reported by os.stat().\n"
                },
                {
                    "name": "getsize",
                    "content": "Return the size of a file, reported by os.stat().\n"
                },
                {
                    "name": "isabs",
                    "content": "Test whether a path is absolute\n"
                },
                {
                    "name": "isdir",
                    "content": "Return true if the pathname refers to an existing directory.\n"
                },
                {
                    "name": "isfile",
                    "content": "Test whether a path is a regular file\n"
                },
                {
                    "name": "islink",
                    "content": "Test whether a path is a symbolic link.\nThis will always return false for Windows prior to 6.0.\n"
                },
                {
                    "name": "ismount",
                    "content": "Test whether a path is a mount point (a drive root, the root of a\nshare, or a mounted volume)\n"
                },
                {
                    "name": "join",
                    "content": "# Join two (or more) paths.\n"
                },
                {
                    "name": "lexists",
                    "content": "Test whether a path exists.  Returns True for broken symbolic links\n"
                },
                {
                    "name": "normcase",
                    "content": "Normalize case of pathname.\n\nMakes all characters lowercase and all slashes into backslashes.\n"
                },
                {
                    "name": "normpath",
                    "content": "Normalize path, eliminating double slashes, etc.\n\nrealpath = abspathfallback(path)\nReturn the absolute version of a path as a fallback function in case\n`nt.getfullpathname` is not available or raises OSError. See bpo-31047 for\nmore.\n"
                },
                {
                    "name": "relpath",
                    "content": "Return a relative version of a path\n"
                },
                {
                    "name": "samefile",
                    "content": "Test whether two pathnames reference the same actual file or directory\n\nThis is determined by the device number and i-node number and\nraises an exception if an os.stat() call on either pathname fails.\n"
                },
                {
                    "name": "sameopenfile",
                    "content": "Test whether two open file objects reference the same file\n"
                },
                {
                    "name": "samestat",
                    "content": "Test whether two stat buffers reference the same file\n"
                },
                {
                    "name": "split",
                    "content": "Split a pathname.\n\nReturn tuple (head, tail) where tail is everything after the final slash.\nEither part may be empty.\n"
                },
                {
                    "name": "splitdrive",
                    "content": "Split a pathname into drive/UNC sharepoint and relative path specifiers.\nReturns a 2-tuple (driveorunc, path); either part may be empty.\n\nIf you assign\nresult = splitdrive(p)\nIt is always true that:\nresult[0] + result[1] == p\n\nIf the path contained a drive letter, driveorunc will contain everything\nup to and including the colon.  e.g. splitdrive(\"c:/dir\") returns (\"c:\", \"/dir\")\n\nIf the path contained a UNC path, the driveorunc will contain the host name\nand share up to but not including the fourth directory separator character.\ne.g. splitdrive(\"//host/computer/dir\") returns (\"//host/computer\", \"/dir\")\n\nPaths cannot contain both a drive letter and a UNC path.\n"
                },
                {
                    "name": "splitext",
                    "content": "Split the extension from a pathname.\n\nExtension is everything from the last dot to the end, ignoring\nleading dots.  Returns \"(root, ext)\"; ext may be empty.\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['normcase', 'isabs', 'join', 'splitdrive', 'split', 'splite...\naltsep = '/'\ncurdir = '.'\ndefpath = r'.;C:\\bin'\ndevnull = 'nul'\nextsep = '.'\npardir = '..'\npathsep = ';'\nsep = r'\\'\nsupportsunicodefilenames = False\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/ntpath.py\n\n",
            "subsections": []
        }
    },
    "summary": "ntpath - Common pathname manipulations, WindowsNT/95 version.",
    "flags": [],
    "examples": [],
    "see_also": []
}