1 #返回标准化的绝对路径,基本等同于normpath() 2 os.path.abspath(path) 3 4 #返回文件名 5 os.path.basename(path) 6 7 #返回目录名 8 os.path.dirname(p
#是否存在目录或打开的文件描述符 os.path.exists(path) #文件判断 os.path.isfile(path) #目录判断 os.path.isdir()
原文:https://www.cnblogs.com/jimywu/p/12261957.html