What's the Python equivalent to Deno's ensureDir
?
Usage example:
import { ensureDir, ensureDirSync } from "https://deno.land/std/fs/mod.ts";
ensureDir("./logs").then(
() => console.log("Success Created"),
).catch((err) => console.log(err));
You can use pathlib.Path.mkdir
. Example:
import pathlib
pathlib.Path.home().joinpath(".local", "extra", "path").mkdir(
parents=True, exist_ok=True
)