Python3 os.makedirs() 方法
Python 3 教程
· 2019-02-07 15:13:15
概述
os.makedirs() 方法用于递归创建目录。像 mkdir(), 但创建的所有intermediate-level文件夹需要包含子目录。
语法
makedirs()方法语法格式如下:
os.makedirs(path, mode=0o777)
参数
path -- 需要递归创建的目录。
mode -- 权限模式。
返回值
该方法没有返回值。
实例
以下实例演示了 makedirs() 方法的使用:
#!/usr/bin/python3
import os, sys
# 创建的目录
path = "/tmp/home/monthly/daily"
os.makedirs( path, 0o777 );
print ("路径被创建")
执行以上程序输出结果为:
路径被创建
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
Writing Apache Modules with Perl and C
Lincoln Stein、Doug MacEachern / O'Reilly Media, Inc. / 1999-03 / USD 39.95
Apache is the most popular Web server on the Internet because it is free, reliable, and extensible. The availability of the source code and the modular design of Apache makes it possible to extend Web......一起来看看 《Writing Apache Modules with Perl and C》 这本书的介绍吧!