Created
November 17, 2023 15:57
-
-
Save renegarcia/0f8f2acc1a002ecec5b02d9b9e12eefb to your computer and use it in GitHub Desktop.
Python tip: Create directories recursively if don´t exist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
def create_dirs_recursively(location: str): | |
Path(location).mkdir(parents=True, exist_ok=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment