Skip to content

Instantly share code, notes, and snippets.

@sebastianschramm
Last active August 12, 2022 18:14
Show Gist options
  • Save sebastianschramm/2c59e498e7120bf90b158f5bcaaaa794 to your computer and use it in GitHub Desktop.
Save sebastianschramm/2c59e498e7120bf90b158f5bcaaaa794 to your computer and use it in GitHub Desktop.
How to create a directory and all of it's parent directories if none or some of them do not exist yet?
from pathlib import Path
data_directory_path = Path('data/assets')
data_directory_path.mkdir(parents=True, exist_ok=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment