欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

python 文件操作 os.mkdir()函数

发布时间:2025/3/19 48 豆豆
生活随笔 收集整理的这篇文章主要介绍了 python 文件操作 os.mkdir()函数 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

os.mkdir() 方法用于以数字权限模式创建目录。默认的模式为 0777 (八进制)。

os.mkdir(path[, mode])

path – 要创建的目录
mode – 要为目录设置的权限数字模式(windows平台忽略该参数)

def mkdir(*args, **kwargs): # real signature unknown"""Create a directory.If dir_fd is not None, it should be a file descriptor open to a directory,and path should be relative; path will then be relative to that directory.dir_fd may not be implemented on your platform.If it is unavailable, using it will raise a NotImplementedError.The mode argument is ignored on Windows.创建目录。如果dir_fd不是None,它应该是一个打开到目录的文件描述符,路径应该是相对的;然后路径将是相对于该目录的。dir_fd可能无法在您的平台上实现。如果它不可用,则使用它将引发NotImplementedError。在Windows上忽略mode参数。"""pass

参考文章:Python os.mkdir() 方法

总结

以上是生活随笔为你收集整理的python 文件操作 os.mkdir()函数的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。