os模块

作者: Iphone60Plus | 来源:发表于2020-04-14 20:17 被阅读0次

    os.getcwd() # 返回当前工作目录
    os.listdir(path) # 返回path指定的文件夹包含的文件或文件夹的名字的列表
    os.mkdir(path) # 创建文件夹
    os.path.abspath(path) # 返回绝对路径
    os.path.basename(path) # 返回文件名
    os.path.isfile(path) # 判断路径是否为文件
    os.path.isdir(path) # 判断路径是否为目录
    os.replace(file1,file2) #将file1重命名为file2

    相关文章

      网友评论

          本文标题:os模块

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