Skip to content

Instantly share code, notes, and snippets.

@engineervix
Created January 28, 2020 20:36
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 engineervix/66532b6c853e8a4ac9b504aba9ce45ee to your computer and use it in GitHub Desktop.
Save engineervix/66532b6c853e8a4ac9b504aba9ce45ee to your computer and use it in GitHub Desktop.
create directories if they don't exist
import os
d = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
out_dir = os.path.join(d, "dir_name")
os.makedirs(out_dir, exist_ok=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment