列出目录中的文件和子目录
files_and_directories = os.listdir(directory_path)
获取文件属性
file_stat = os.stat(file_path)
路径拼接
path1 = "/path/to" path2 = "directory" full_path = os.path.join(path1, path2)
标签:path2,stat,path1,file,path,os From: https://www.cnblogs.com/mxleader/p/17857655.html