This method recursive directory creation function. Like mkdir(), but makes all intermediate-level directories needed to contain the leaf directory.
os.makedirs(path[, mode])
Here is the detail of parameters:
path: This is the path which needs to be created recursively.
mode: Mode of the directories to be given.
#!/usr/bin/python import os, sys # Path to be created path = "/tmp/home/monthly/daily" os.makedirs( path, 0755 ); print "Path is created"
This would produce following result:
Path is created
Advertisement