Skip to content

Instantly share code, notes, and snippets.

@minstrel271
Last active March 11, 2016 08:35
Show Gist options
  • Save minstrel271/c85591c5e3280aa24493 to your computer and use it in GitHub Desktop.
Save minstrel271/c85591c5e3280aa24493 to your computer and use it in GitHub Desktop.
import os
def ensure_dir(path):
d = os.path.dirname(path)
if not os.path.exists(d):
os.makedirs(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment