Last active
August 23, 2017 19:03
-
-
Save dhruvkar/0261b35be112fc45581bf84f3268a10a to your computer and use it in GitHub Desktop.
best way to make a directory in python
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
def mkdir(dir_path) | |
try: | |
os.makedirs(dir_path) | |
except OSError as e: | |
if e.errno != errno.EEXIST: | |
raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment