Created
January 27, 2018 11:20
-
-
Save fawkesley/0afc1b96cb7bf0b13ee922709519288d to your computer and use it in GitHub Desktop.
Python `mkdir -p` equivalent
This file contains hidden or 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
import os | |
def mkdir_p(directory): | |
if not os.path.isdir(directory): | |
os.makedirs(directory) | |
return directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment