os模块

作者: fxxtat | 来源:发表于2016-08-06 22:07 被阅读0次

    os.walk:

    os.walk(top,topdown=True,onerror=None,followlinks=False)
    return 三元tupple(dirpath,dirnames,filenames)

    dirpath : 类型为string 目录的路径
    dirnames : 类型为list 包含了dirpath的所有子目录的名字
    filenames : 类型是list 包含了非目录文件的名字

    这些名字不包含路径信息,如果要得到全部路径,使用os.path.join(dirpath,name)得到

    相关文章

      网友评论

          本文标题:os模块

          本文链接:https://www.haomeiwen.com/subject/rjzksttx.html