python check if dir exists else create

Solutions on MaxInterview for python check if dir exists else create by the best coders in the world

showing results for - "python check if dir exists else create"
Ilaria
25 Mar 2018
1from pathlib import Path
2Path("/my/directory").mkdir(parents=True, exist_ok=True)
3
Kilyan
27 Sep 2018
1from pathlib import Path
2Path("/my/directory").mkdir(parents=True, exist_ok=True)
3