elegant way to make directory recursively in Python?
- by user248237
I would like to make a directory in a "recursive" way, i.e. have a function make_directory() that behaves as follows:
make_directory("a/b/c/d/") should create directory a, then child b, then c, then d. If any of the parent directories exist it should not make them. E.g. if "a" exists, then b should be a subdir of that, and then c should be made inside b, etc.
how can I do this in python? os.mkdir does not have this behavior.