Skip to content

Instantly share code, notes, and snippets.

@sboysel
Created May 21, 2024 16:44
Show Gist options
  • Save sboysel/4034ccfd10291a86366aa57ec1de7067 to your computer and use it in GitHub Desktop.
Save sboysel/4034ccfd10291a86366aa57ec1de7067 to your computer and use it in GitHub Desktop.
package root variable
"""
simple way to get the directory path of the current file.
Extension: simply add additonal `.parent`s if __file__ is in a subdirectory of ROOT
"""
import pathlib
ROOT = pathlib.Path(__file__).parent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment