Skip to content

Instantly share code, notes, and snippets.

@julienr
Created June 8, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienr/e1407ac4caafd19b68cd to your computer and use it in GitHub Desktop.
Save julienr/e1407ac4caafd19b68cd to your computer and use it in GitHub Desktop.
mkdir -p in python
import os
import errno
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST:
pass
else: raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment