Home > Article > Backend Development > How to use the mkdir method in python
Usage of the mkdir method in python: [os.mkdir(path[, mode])]. The os.mkdir() method is used to create a directory in digital permission mode. The default mode is 0777. This method has no return value.
The os.mkdir() method is used to create a directory in digital permission mode. The default mode is 0777 (octal).
The syntax format of the mkdir() method is as follows:
os.mkdir(path[, mode])
The parameters :path -- the directory to be created, mode -- the permission numeric mode to be set for the directory
Return value:
There is no return value for the modified method
The following example demonstrates the use of the mkdir() method:
The output result of executing the above program is:
目录已创建
The above is the detailed content of How to use the mkdir method in python. For more information, please follow other related articles on the PHP Chinese website!