Max B. answered 04/06/23
University lecturer & senior engineer tutoring Python, other languages
You can use `pathlib.Path("/path/to/directory").mkdir()` to solve your problem. You probably want to use `parents=True` to make any intermediate directories and `exist_ok=True` to stop and not raise an exception if the directory already exists. You must have Python 3.5+, though, since this `exist_ok` was added in version 3.5.
See the docs for more info: https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir