How can I safely create a directory (possibly including intermediate directories)?
5.5k
I am writing a file using Python, and I want it to be placed in a specific path. How can I safely make sure that the path exists? That is: how can I check whether the folder exists, along with its parents? If there are missing folders along the path, how can I create them?