Skip to content

Instantly share code, notes, and snippets.

@ecovictoriano
Last active December 28, 2017 00:51
Show Gist options
  • Save ecovictoriano/b7c020acf94b9d595f1ea49279a970a5 to your computer and use it in GitHub Desktop.
Save ecovictoriano/b7c020acf94b9d595f1ea49279a970a5 to your computer and use it in GitHub Desktop.
Create folders/directories if not exists
# assuming we're inside "/a/b/c/d" directory
if not os.path.exists('./x/y/z'):
os.makedirs('./x/y/z')
# this will create the folders "x", "y", and "z"
"""
.
|-- a
| `-- b
| `-- c
| `-- d
| `-- x
| `-- y
| `-- z
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment