階層のあるフォルダを再帰的に生成する
フォルダが既に存在していても、エラーにはなりません。
import os dir_path = 'D:\\01_Test\\New\\Sub1\\Sub2\\Sub3' os.makedirs(dir_path)
指定のフォルダだけを作成する場合
こちらはフォルダが既に存在している場合、エラーになります。
import os dir_path = 'D:\\dev\\Test\\New' os.mkdir(dir_path)
同じことを別の言語でやりたいとき

