Python method mkdir() create a directory named path with a numeric mode. The default mode is 0777 (octal). On some systems, the mode is ignored. Where it is used, the current mask value is first masked out.
Following is the syntax for mkdir() method:
This method does not return any value.
The following example shows the usage of mkdir() method.
#!/usr/bin/python import os, sys # Path to be created path = "/tmp/home/monthly/daily/hourly" os.mkdir( path, 0755 ); print "Path is created"
When we run the above program, it produces the following result:
Path is created
Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.