Skip to content

Instantly share code, notes, and snippets.

@renegarcia
Created November 17, 2023 15:57
Show Gist options
  • Save renegarcia/0f8f2acc1a002ecec5b02d9b9e12eefb to your computer and use it in GitHub Desktop.
Save renegarcia/0f8f2acc1a002ecec5b02d9b9e12eefb to your computer and use it in GitHub Desktop.
Python tip: Create directories recursively if don´t exist
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