Created
October 2, 2012 22:57
-
-
Save andrewdyates/3823842 to your computer and use it in GitHub Desktop.
A simple make directory function in Python that I must have copy-pasted 100 times.
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
#!/usr/bin/python | |
import os, errno | |
def make_dir(outdir): | |
try: | |
os.makedirs(outdir) | |
except OSError, e: | |
if e.errno != errno.EEXIST: raise | |
return outdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment