Python_API_os.path_walk_待填充

来源:互联网 发布:朋友圈微商软文软件 编辑:程序博客网 时间:2024/05/21 17:42
os.path.walk(path,visit, arg)

Calls the function visit with arguments (arg, dirname, names) for each directory in the directory tree rooted at path (includingpath itself, if it is a directory). The argument dirname specifies the visited directory, the argumentnames lists the files in the directory (gotten from os.listdir(dirname)). The visit function may modifynames to influence the set of directories visited below dirname, e.g. to avoid visiting certain parts of the tree. (The object referred to bynames must be modified in place, using del or slice assignment.)

Note

Symbolic links to directories are not treated as subdirectories, and thatwalk() therefore will not visit them. To visit linked directories you must identify them withos.path.islink(file) andos.path.isdir(file), and invokewalk() as necessary.

Note

This function is deprecated and has been removed in 3.0 in favor ofos.walk().


原创粉丝点击