Create a directory

suggest change
from pathlib import Path

Path("newdir").mkdir()

If you need to specify permissions, you can use the optional mode argument:

Path("newdir").mkdir(mode=0o700)

Pass parents=True to create missing parent directories and exist_ok=True when an existing directory should not be an error. Permission bits are subject to the process's umask and are handled differently on Windows.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents