Skip to content

Instantly share code, notes, and snippets.

@robsgithub
Last active August 3, 2018 20:20
Show Gist options
  • Save robsgithub/4b280b5b033455931feb1f59ca607c40 to your computer and use it in GitHub Desktop.
Save robsgithub/4b280b5b033455931feb1f59ca607c40 to your computer and use it in GitHub Desktop.

Folder operations

Check for existence and create

if not os.path.exists( export_directory ) :
    os.makedirs(export_directory)
    os.mkdir(export_directory)
    

Get the base directory

parent_folder_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment