os.path.realpath
时间: 2023-11-23 16:25:23 浏览: 118
realpath:这是Go(golang)中realpath()函数的实现。 它告诉给定相对路径的绝对路径
os.path.realpath is a method in the Python programming language's os module that returns the absolute path of a given file or directory. The returned path is the canonicalized absolute pathname, resolving any symbolic links or references to "." or ".." components in the path.
For example, if the input path is a symbolic link to a file or directory, os.path.realpath will return the absolute path of the target file or directory, rather than the symbolic link itself.
Syntax:
os.path.realpath(path)
Parameters:
path: A string representing the path of the file or directory.
Return Value:
The os.path.realpath method returns the absolute path of the file or directory as a string.
阅读全文