os.mkdir(path[, mode])
path -- 這是需要建立的路徑
mode -- 這是要建立的目錄的模式
#!/usr/bin/python3 import os, sys # Path to be created path = "/tmp/home/monthly/daily/hourly" os.mkdir( path, 0755 ); print "Path is created"
Path is created