Last active
December 28, 2017 00:51
-
-
Save ecovictoriano/b7c020acf94b9d595f1ea49279a970a5 to your computer and use it in GitHub Desktop.
Create folders/directories if not exists
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
# 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